This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 2d6c62549d38435772639b546037c9c07d643e5a (commit)
via 2e0abe9481e6eb6b3936cbae43b2dee493f1230d (commit)
via aaaf73fa8358aeceb9382abaa86db0ef8108b9ae (commit)
via b08a760d4a221ebc2cb15c4381b6383e05a44358 (commit)
from 01467300f870baa47686ec2c288d34bb925c58a7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/2d6c62549d38435772639b546037c9c07d643e5a
commit 2d6c62549d38435772639b546037c9c07d643e5a
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 23:55:56 2013 +0200
Added compilation check for dangerous use of 'extern' keyword
diff --git a/configure.ac b/configure.ac
index 77d16db..48c2637 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,11 @@ AS_IF([test "x$debug" = "xyes"],
dnl Try to report misuses of '&' versus '&&' and similar
AX_CFLAGS_GCC_OPTION([-Wlogical-op])
dnl
+ dnl Reports declaration of global things that are done inside
+ dnl a local environment, instead of using the appropriate
+ dnl header
+ AX_CFLAGS_GCC_OPTION([-Wnested-externs])
+ dnl
dnl Use of 'sizeof()' on inappropriate pointer types
AX_CFLAGS_GCC_OPTION([-Wpointer-arith])
], [dnl
http://repo.or.cz/w/wmaker-crm.git/commit/2e0abe9481e6eb6b3936cbae43b2dee493f1230d
commit 2e0abe9481e6eb6b3936cbae43b2dee493f1230d
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 23:55:55 2013 +0200
wmaker: Moved definition of global variable 'wKeyBindings' to header
Multiple declaration of global variables in local source files is
a dangerous idea.
diff --git a/src/cycling.c b/src/cycling.c
index a1816dd..7a9afc9 100644
--- a/src/cycling.c
+++ b/src/cycling.c
@@ -38,8 +38,6 @@
#include "xinerama.h"
#include "switchpanel.h"
-/* Globals */
-extern WShortKey wKeyBindings[WKBD_LAST];
static void raiseWindow(WSwitchPanel * swpanel, WWindow * wwin)
{
diff --git a/src/defaults.c b/src/defaults.c
index 1eaa3cf..0fb2bbc 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -71,8 +71,6 @@
#define GLOBAL_DEFAULTS_SUBDIR "WindowMaker"
#endif
-/***** Global *****/
-extern WShortKey wKeyBindings[WKBD_LAST];
typedef struct _WDefaultEntry WDefaultEntry;
typedef int (WDECallbackConvert) (WScreen *scr, WDefaultEntry *entry,
WMPropList *plvalue, void *addr, void **tdata);
diff --git a/src/event.c b/src/event.c
index 31a82a3..6a34892 100644
--- a/src/event.c
+++ b/src/event.c
@@ -76,8 +76,6 @@
#include "winmenu.h"
#include "switchmenu.h"
-/******** Global Variables **********/
-extern WShortKey wKeyBindings[WKBD_LAST];
#define MOD_MASK wPreferences.modifier_mask
diff --git a/src/keybind.h b/src/keybind.h
index bf02965..6576a16 100644
--- a/src/keybind.h
+++ b/src/keybind.h
@@ -128,6 +128,12 @@ typedef struct WShortKey {
KeyCode keycode;
} WShortKey;
+/* ---[ Global Variables ]------------------------------------------------ */
+
+extern WShortKey wKeyBindings[WKBD_LAST];
+
+/* ---[ Functions ]------------------------------------------------------- */
+
void wKeyboardInitialize(void);
#endif /* WMKEYBIND_H */
diff --git a/src/startup.c b/src/startup.c
index 915e065..90154d8 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -84,9 +84,6 @@
# define SA_NODEFER 0
#endif
-/****** Global Variables ******/
-extern WShortKey wKeyBindings[WKBD_LAST];
-
/***** Local *****/
static WScreen **wScreen = NULL;
static unsigned int _NumLockMask = 0;
diff --git a/src/window.c b/src/window.c
index 7b3cda2..df7e6ca 100644
--- a/src/window.c
+++ b/src/window.c
@@ -72,8 +72,6 @@
#define MOD_MASK wPreferences.modifier_mask
-/****** Global Variables ******/
-extern WShortKey wKeyBindings[WKBD_LAST];
/***** Local Stuff *****/
static WWindowState *windowState = NULL;
diff --git a/src/winmenu.c b/src/winmenu.c
index b4773a6..8201747 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -68,9 +68,6 @@
#define WO_OMNIPRESENT 2
#define WO_ENTRIES 3
-/**** Global data ***/
-extern WShortKey wKeyBindings[WKBD_LAST];
-
static void updateOptionsMenu(WMenu * menu, WWindow * wwin);
diff --git a/src/workspace.c b/src/workspace.c
index 9455691..d02e9f7 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -59,7 +59,6 @@
#define MAX_SHORTCUT_LENGTH 32
#define WORKSPACE_NAME_DISPLAY_PADDING 32
-extern WShortKey wKeyBindings[WKBD_LAST];
static WMPropList *dWorkspaces = NULL;
static WMPropList *dClip, *dName;
http://repo.or.cz/w/wmaker-crm.git/commit/aaaf73fa8358aeceb9382abaa86db0ef8108b9ae
commit aaaf73fa8358aeceb9382abaa86db0ef8108b9ae
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 23:55:54 2013 +0200
wmaker: Moved global domain definition to the global namespace
The default domains were originally defined in different global
variables in C files; This patches groups them in a single
structure placed in global namespace.
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 46ba189..f4fa5b8 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -481,6 +481,14 @@ extern struct wmaker_global_variables {
} timestamp;
+ /* Global Domains, for storing dictionaries */
+ struct {
+ /* Note: you must #include <defaults.h> if you want to use them
*/
+ struct WDDomain *wmaker;
+ struct WDDomain *window_attr;
+ struct WDDomain *root_menu;
+ } domain;
+
/* Screens related */
int screen_count;
diff --git a/src/appicon.c b/src/appicon.c
index 4ccd3a4..ee6aed6 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -60,9 +60,6 @@
* using the classname/instancename
*/
-/**** Global variables ****/
-extern WDDomain *WDWindowAttributes;
-
#define MOD_MASK wPreferences.modifier_mask
#define ICON_SIZE wPreferences.icon_size
@@ -1084,7 +1081,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
/* This function save the application icon and store the path in the
Dictionary */
static void wApplicationSaveIconPathFor(const char *iconPath, const char
*wm_instance, const char *wm_class)
{
- WMPropList *dict = WDWindowAttributes->dictionary;
+ WMPropList *dict = w_global.domain.window_attr->dictionary;
WMPropList *adict, *key, *iconk;
WMPropList *val;
char *tmp;
@@ -1118,7 +1115,7 @@ static void wApplicationSaveIconPathFor(const char
*iconPath, const char *wm_ins
WMReleasePropList(iconk);
if (val && !wPreferences.flags.noupdates)
- UpdateDomainFile(WDWindowAttributes);
+ UpdateDomainFile(w_global.domain.window_attr);
}
static WAppIcon *findDockIconFor(WDock *dock, Window main_window)
diff --git a/src/defaults.c b/src/defaults.c
index 705142d..1eaa3cf 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -72,9 +72,6 @@
#endif
/***** Global *****/
-extern WDDomain *WDWindowMaker;
-extern WDDomain *WDWindowAttributes;
-extern WDDomain *WDRootMenu;
extern WShortKey wKeyBindings[WKBD_LAST];
typedef struct _WDefaultEntry WDefaultEntry;
@@ -971,21 +968,21 @@ void wDefaultsCheckDomains(void* arg)
WMPropList *dict;
int i;
- if (stat(WDWindowMaker->path, &stbuf) >= 0 && WDWindowMaker->timestamp
< stbuf.st_mtime) {
- WDWindowMaker->timestamp = stbuf.st_mtime;
+ if (stat(w_global.domain.wmaker->path, &stbuf) >= 0 &&
w_global.domain.wmaker->timestamp < stbuf.st_mtime) {
+ w_global.domain.wmaker->timestamp = stbuf.st_mtime;
/* Global dictionary */
shared_dict = readGlobalDomain("WindowMaker", True);
/* User dictionary */
- dict = WMReadPropListFromFile(WDWindowMaker->path);
+ dict = WMReadPropListFromFile(w_global.domain.wmaker->path);
if (dict) {
if (!WMIsPLDictionary(dict)) {
WMReleasePropList(dict);
dict = NULL;
wwarning(_("Domain %s (%s) of defaults database
is corrupted!"),
- "WindowMaker", WDWindowMaker->path);
+ "WindowMaker",
w_global.domain.wmaker->path);
} else {
if (shared_dict) {
WMMergePLDictionaries(shared_dict,
dict, True);
@@ -1000,10 +997,10 @@ void wDefaultsCheckDomains(void* arg)
wReadDefaults(scr, dict);
}
- if (WDWindowMaker->dictionary)
-
WMReleasePropList(WDWindowMaker->dictionary);
+ if (w_global.domain.wmaker->dictionary)
+
WMReleasePropList(w_global.domain.wmaker->dictionary);
- WDWindowMaker->dictionary = dict;
+ w_global.domain.wmaker->dictionary = dict;
}
} else {
wwarning(_("could not load domain %s from user defaults
database"), "WindowMaker");
@@ -1014,17 +1011,17 @@ void wDefaultsCheckDomains(void* arg)
}
- if (stat(WDWindowAttributes->path, &stbuf) >= 0 &&
WDWindowAttributes->timestamp < stbuf.st_mtime) {
+ if (stat(w_global.domain.window_attr->path, &stbuf) >= 0 &&
w_global.domain.window_attr->timestamp < stbuf.st_mtime) {
/* global dictionary */
shared_dict = readGlobalDomain("WMWindowAttributes", True);
/* user dictionary */
- dict = WMReadPropListFromFile(WDWindowAttributes->path);
+ dict =
WMReadPropListFromFile(w_global.domain.window_attr->path);
if (dict) {
if (!WMIsPLDictionary(dict)) {
WMReleasePropList(dict);
dict = NULL;
wwarning(_("Domain %s (%s) of defaults database
is corrupted!"),
- "WMWindowAttributes",
WDWindowAttributes->path);
+ "WMWindowAttributes",
w_global.domain.window_attr->path);
} else {
if (shared_dict) {
WMMergePLDictionaries(shared_dict,
dict, True);
@@ -1033,10 +1030,10 @@ void wDefaultsCheckDomains(void* arg)
shared_dict = NULL;
}
- if (WDWindowAttributes->dictionary)
-
WMReleasePropList(WDWindowAttributes->dictionary);
+ if (w_global.domain.window_attr->dictionary)
+
WMReleasePropList(w_global.domain.window_attr->dictionary);
- WDWindowAttributes->dictionary = dict;
+ w_global.domain.window_attr->dictionary = dict;
for (i = 0; i < w_global.screen_count; i++) {
scr = wScreenWithNumber(i);
if (scr) {
@@ -1053,30 +1050,30 @@ void wDefaultsCheckDomains(void* arg)
wwarning(_("could not load domain %s from user defaults
database"), "WMWindowAttributes");
}
- WDWindowAttributes->timestamp = stbuf.st_mtime;
+ w_global.domain.window_attr->timestamp = stbuf.st_mtime;
if (shared_dict)
WMReleasePropList(shared_dict);
}
- if (stat(WDRootMenu->path, &stbuf) >= 0 && WDRootMenu->timestamp <
stbuf.st_mtime) {
- dict = WMReadPropListFromFile(WDRootMenu->path);
+ if (stat(w_global.domain.root_menu->path, &stbuf) >= 0 &&
w_global.domain.root_menu->timestamp < stbuf.st_mtime) {
+ dict = WMReadPropListFromFile(w_global.domain.root_menu->path);
if (dict) {
if (!WMIsPLArray(dict) && !WMIsPLString(dict)) {
WMReleasePropList(dict);
dict = NULL;
wwarning(_("Domain %s (%s) of defaults database
is corrupted!"),
- "WMRootMenu", WDRootMenu->path);
+ "WMRootMenu",
w_global.domain.root_menu->path);
} else {
- if (WDRootMenu->dictionary)
-
WMReleasePropList(WDRootMenu->dictionary);
+ if (w_global.domain.root_menu->dictionary)
+
WMReleasePropList(w_global.domain.root_menu->dictionary);
- WDRootMenu->dictionary = dict;
- wDefaultsMergeGlobalMenus(WDRootMenu);
+ w_global.domain.root_menu->dictionary = dict;
+
wDefaultsMergeGlobalMenus(w_global.domain.root_menu);
}
} else {
wwarning(_("could not load domain %s from user defaults
database"), "WMRootMenu");
}
- WDRootMenu->timestamp = stbuf.st_mtime;
+ w_global.domain.root_menu->timestamp = stbuf.st_mtime;
}
#ifndef HAVE_INOTIFY
if (!arg)
@@ -1092,7 +1089,7 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
int update_workspace_back = 0; /* kluge :/ */
unsigned int needs_refresh;
void *tdata;
- WMPropList *old_dict = (WDWindowMaker->dictionary != new_dict ?
WDWindowMaker->dictionary : NULL);
+ WMPropList *old_dict = (w_global.domain.wmaker->dictionary != new_dict
? w_global.domain.wmaker->dictionary : NULL);
needs_refresh = 0;
@@ -1995,7 +1992,7 @@ getWSSpecificBackground(WScreen * scr, WDefaultEntry *
entry, WMPropList * value
if (!scr->flags.backimage_helper_launched && !scr->flags.startup) {
WMPropList *key = WMCreatePLString("WorkspaceBack");
- WMRemoveFromPLDictionary(WDWindowMaker->dictionary, key);
+ WMRemoveFromPLDictionary(w_global.domain.wmaker->dictionary,
key);
WMReleasePropList(key);
}
diff --git a/src/dialog.c b/src/dialog.c
index 992078a..a00de06 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1454,8 +1454,6 @@ void wShowLegalPanel(WScreen * scr)
***********************************************************************
*/
-extern WDDomain *WDWindowAttributes;
-
typedef struct _CrashPanel {
WMWindow *win; /* main window */
diff --git a/src/main.c b/src/main.c
index da6d0b6..dac5fdf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -76,11 +76,6 @@ struct WPreferences wPreferences;
WShortKey wKeyBindings[WKBD_LAST];
-/* defaults domains */
-WDDomain *WDWindowMaker = NULL;
-WDDomain *WDWindowAttributes = NULL;
-WDDomain *WDRootMenu = NULL;
-
/* notifications */
const char WMNManaged[] = "WMNManaged";
const char WMNUnmanaged[] = "WMNUnmanaged";
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 72ae878..10e2397 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -60,7 +60,6 @@
#define MAX_SHORTCUT_LENGTH 32
-extern WDDomain *WDRootMenu;
static WMenu *readMenuPipe(WScreen * scr, char **file_name);
static WMenu *readPLMenuPipe(WScreen * scr, char **file_name);
@@ -1462,7 +1461,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList *
definition, Bool include
if (!scr->root_menu || stat_buf.st_mtime >
scr->root_menu->timestamp
/* if the pointer in WMRootMenu has changed */
- || WDRootMenu->timestamp > scr->root_menu->timestamp) {
+ || w_global.domain.root_menu->timestamp >
scr->root_menu->timestamp) {
if (menu_is_default) {
wwarning(_
@@ -1472,7 +1471,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList *
definition, Bool include
menu = readMenuFile(scr, path);
if (menu)
- menu->timestamp = WMAX(stat_buf.st_mtime,
WDRootMenu->timestamp);
+ menu->timestamp = WMAX(stat_buf.st_mtime,
w_global.domain.root_menu->timestamp);
} else {
menu = NULL;
}
@@ -1617,17 +1616,17 @@ void OpenRootMenu(WScreen * scr, int x, int y, int
keyboard)
return;
}
- definition = WDRootMenu->dictionary;
+ definition = w_global.domain.root_menu->dictionary;
/*
definition = PLGetDomain(domain);
*/
if (definition) {
if (WMIsPLArray(definition)) {
- if (!scr->root_menu || WDRootMenu->timestamp >
scr->root_menu->timestamp) {
+ if (!scr->root_menu ||
w_global.domain.root_menu->timestamp > scr->root_menu->timestamp) {
menu = configureMenu(scr, definition, True);
if (menu)
- menu->timestamp = WDRootMenu->timestamp;
+ menu->timestamp =
w_global.domain.root_menu->timestamp;
} else
menu = NULL;
diff --git a/src/screen.c b/src/screen.c
index 32620af..c1fa714 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -69,11 +69,6 @@
|SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask
|KeyPressMask|KeyReleaseMask)
-/**** Global variables ****/
-
-extern WDDomain *WDWindowMaker;
-
-/**** Local ****/
#define STIPPLE_WIDTH 2
#define STIPPLE_HEIGHT 2
static char STIPPLE_DATA[] = { 0x02, 0x01 };
@@ -619,7 +614,7 @@ WScreen *wScreenInit(int screen_number)
scr->info_window = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 10,
10, 0, 0, 0);
/* read defaults for this screen */
- wReadDefaults(scr, WDWindowMaker->dictionary);
+ wReadDefaults(scr, w_global.domain.wmaker->dictionary);
{
XColor xcol;
diff --git a/src/startup.c b/src/startup.c
index c6438ea..915e065 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -85,9 +85,6 @@
#endif
/****** Global Variables ******/
-extern WDDomain *WDWindowMaker;
-extern WDDomain *WDRootMenu;
-extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST];
/***** Local *****/
@@ -560,13 +557,13 @@ void StartUp(Bool defaultScreenOnly)
WMHookEventHandler(DispatchEvent);
/* initialize defaults stuff */
- WDWindowMaker = wDefaultsInitDomain("WindowMaker", True);
- if (!WDWindowMaker->dictionary)
+ w_global.domain.wmaker = wDefaultsInitDomain("WindowMaker", True);
+ if (!w_global.domain.wmaker->dictionary)
wwarning(_("could not read domain "%s" from defaults
database"), "WindowMaker");
/* read defaults that don't change until a restart and are
* screen independent */
- wReadStaticDefaults(WDWindowMaker ? WDWindowMaker->dictionary : NULL);
+ wReadStaticDefaults(w_global.domain.wmaker ?
w_global.domain.wmaker->dictionary : NULL);
/* check sanity of some values */
if (wPreferences.icon_size < 16) {
@@ -576,14 +573,14 @@ void StartUp(Bool defaultScreenOnly)
}
/* init other domains */
- WDRootMenu = wDefaultsInitDomain("WMRootMenu", False);
- if (!WDRootMenu->dictionary)
+ w_global.domain.root_menu = wDefaultsInitDomain("WMRootMenu", False);
+ if (!w_global.domain.root_menu->dictionary)
wwarning(_("could not read domain "%s" from defaults
database"), "WMRootMenu");
- wDefaultsMergeGlobalMenus(WDRootMenu);
+ wDefaultsMergeGlobalMenus(w_global.domain.root_menu);
- WDWindowAttributes = wDefaultsInitDomain("WMWindowAttributes", True);
- if (!WDWindowAttributes->dictionary)
+ w_global.domain.window_attr = wDefaultsInitDomain("WMWindowAttributes",
True);
+ if (!w_global.domain.window_attr->dictionary)
wwarning(_("could not read domain "%s" from defaults
database"), "WMWindowAttributes");
XSetErrorHandler((XErrorHandler) catchXError);
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 3378790..a181832 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -47,9 +47,6 @@
if (value) {attr->flag = getBool(attrib, value); if (mask) mask->flag
= 1;}
-/* Global stuff */
-extern WDDomain *WDWindowAttributes;
-
/* Local stuff */
/* type converters */
@@ -177,8 +174,8 @@ static WMPropList *get_value_from_instanceclass(const char
*value)
WMPLSetCaseSensitive(True);
- if (WDWindowAttributes->dictionary)
- val = key ?
WMGetFromPLDictionary(WDWindowAttributes->dictionary, key) : NULL;
+ if (w_global.domain.window_attr->dictionary)
+ val = key ?
WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key) : NULL;
if (key)
WMReleasePropList(key);
@@ -222,8 +219,8 @@ void wDefaultFillAttributes(const char *instance, const
char *class,
WMPLSetCaseSensitive(True);
- if ((WDWindowAttributes->dictionary) && (useGlobalDefault))
- da = WMGetFromPLDictionary(WDWindowAttributes->dictionary,
AnyWindow);
+ if ((w_global.domain.window_attr->dictionary) && (useGlobalDefault))
+ da =
WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, AnyWindow);
/* get the data */
value = get_value(dw, dc, dn, da, ANoTitlebar, No, useGlobalDefault);
@@ -331,7 +328,7 @@ static WMPropList *get_generic_value(const char *instance,
const char *class,
key = WMCreatePLString(buffer);
wfree(buffer);
- dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary,
key);
+ dict =
WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
WMReleasePropList(key);
if (dict)
@@ -342,7 +339,7 @@ static WMPropList *get_generic_value(const char *instance,
const char *class,
if (!value && instance) {
key = WMCreatePLString(instance);
- dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary,
key);
+ dict =
WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
WMReleasePropList(key);
if (dict)
@@ -353,7 +350,7 @@ static WMPropList *get_generic_value(const char *instance,
const char *class,
if (!value && class) {
key = WMCreatePLString(class);
- dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary,
key);
+ dict =
WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
WMReleasePropList(key);
if (dict)
@@ -363,7 +360,7 @@ static WMPropList *get_generic_value(const char *instance,
const char *class,
/* Search the default icon name - See default_icon argument! */
if (!value && default_icon) {
/* AnyWindow is "*" - see wdefaults.c */
- dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary,
AnyWindow);
+ dict =
WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, AnyWindow);
if (dict)
value = WMGetFromPLDictionary(dict, option);
@@ -403,12 +400,12 @@ char *get_icon_filename(const char *winstance, const char
*wclass, const char *c
wwarning(_("icon "%s" doesn't exist, check your config
files"), file_name);
/* FIXME: Here, if file_path don't exists, then the icon is in
the
- * "icon database" (WDWindowAttributes->dictionary), but the
icon
+ * "icon database" (w_global.domain.window_attr->dictionary),
but the icon
* is not en disk. Therefore, we should remove it from the icon
* database. Is possible to do that using wDefaultChangeIcon()
*/
/* Don't wfree(file_name) here, because is a pointer to the icon
- * dictionary (WDWindowAttributes->dictionary) value. */
+ * dictionary (w_global.domain.window_attr->dictionary) value.
*/
}
if (!file_path && default_icon)
@@ -491,7 +488,7 @@ int wDefaultGetStartWorkspace(WScreen *scr, const char
*instance, const char *cl
if (!ANoTitlebar)
init_wdefaults();
- if (!WDWindowAttributes->dictionary)
+ if (!w_global.domain.window_attr->dictionary)
return -1;
value = get_generic_value(instance, class, AStartWorkspace, True);
@@ -519,7 +516,7 @@ char *wDefaultGetIconFile(const char *instance, const char
*class, Bool default_
if (!ANoTitlebar)
init_wdefaults();
- if (!WDWindowAttributes || !WDWindowAttributes->dictionary)
+ if (!w_global.domain.window_attr ||
!w_global.domain.window_attr->dictionary)
return NULL;
value = get_generic_value(instance, class, AIcon, default_icon);
@@ -534,7 +531,7 @@ char *wDefaultGetIconFile(const char *instance, const char
*class, Bool default_
void wDefaultChangeIcon(WScreen *scr, const char *instance, const char *class,
const char *file)
{
- WDDomain *db = WDWindowAttributes;
+ WDDomain *db = w_global.domain.window_attr;
WMPropList *icon_value = NULL, *value, *attr, *key, *def_win, *def_icon
= NULL;
WMPropList *dict = db->dictionary;
int same = 0;
@@ -611,15 +608,15 @@ void wDefaultPurgeInfo(WScreen *scr, const char
*instance, const char *class)
sprintf(buffer, "%s.%s", instance, class);
key = WMCreatePLString(buffer);
- dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key);
+ dict = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary,
key);
if (dict) {
value = WMGetFromPLDictionary(dict, AIcon);
if (value) {
WMRemoveFromPLDictionary(dict, AIcon);
}
- WMRemoveFromPLDictionary(WDWindowAttributes->dictionary, key);
- UpdateDomainFile(WDWindowAttributes);
+
WMRemoveFromPLDictionary(w_global.domain.window_attr->dictionary, key);
+ UpdateDomainFile(w_global.domain.window_attr);
}
wfree(buffer);
diff --git a/src/winspector.c b/src/winspector.c
index 3be4434..fd2a1ba 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -114,8 +114,6 @@ typedef struct InspectorPanel {
unsigned int choosingIcon:1;
} InspectorPanel;
-extern WDDomain *WDWindowAttributes;
-
static InspectorPanel *panelList = NULL;
static WMPropList *ANoTitlebar = NULL;
static WMPropList *ANoResizebar;
@@ -430,7 +428,7 @@ insertAttribute(WMPropList *dict, WMPropList *window,
WMPropList *attr, WMPropLi
static void saveSettings(WMButton *button, InspectorPanel *panel)
{
WWindow *wwin = panel->inspected;
- WDDomain *db = WDWindowAttributes;
+ WDDomain *db = w_global.domain.window_attr;
WMPropList *dict = NULL;
WMPropList *winDic, *appDic, *value, *value1, *key = NULL, *key2;
char *icon_file, *buf1, *buf2;
http://repo.or.cz/w/wmaker-crm.git/commit/b08a760d4a221ebc2cb15c4381b6383e05a44358
commit b08a760d4a221ebc2cb15c4381b6383e05a44358
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 23:55:53 2013 +0200
wmaker: Moved variable ValidModMask into the global namespace
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 27003d0..46ba189 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -613,6 +613,12 @@ extern struct wmaker_global_variables {
/* Keyboard and shortcuts */
struct {
+ /*
+ * Bit-mask to hide special key modifiers which we don't want to
+ * impact the shortcuts (typically: CapsLock, NumLock,
ScrollLock)
+ */
+ unsigned int modifiers_mask;
+
WMArray *windows[MAX_WINDOW_SHORTCUTS];
} shortcut;
@@ -621,8 +627,6 @@ extern struct wmaker_global_variables {
} w_global;
-extern unsigned int ValidModMask;
-
/****** Notifications ******/
extern const char WMNManaged[];
extern const char WMNUnmanaged[];
diff --git a/src/cycling.c b/src/cycling.c
index 2542bfd..a1816dd 100644
--- a/src/cycling.c
+++ b/src/cycling.c
@@ -144,7 +144,7 @@ void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool
next, Bool class_only)
| PointerMotionMask | ButtonReleaseMask |
EnterWindowMask, &ev);
/* ignore CapsLock */
- modifiers = ev.xkey.state & ValidModMask;
+ modifiers = ev.xkey.state & w_global.shortcut.modifiers_mask;
if (!swpanel)
break;
diff --git a/src/event.c b/src/event.c
index 8629c6c..31a82a3 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1311,7 +1311,7 @@ static void handleKeyPress(XEvent * event)
#endif /*KEEP_XKB_LOCK_STATUS */
/* ignore CapsLock */
- modifiers = event->xkey.state & ValidModMask;
+ modifiers = event->xkey.state & w_global.shortcut.modifiers_mask;
for (i = 0; i < WKBD_LAST; i++) {
if (wKeyBindings[i].keycode == 0)
diff --git a/src/main.c b/src/main.c
index 21e9469..da6d0b6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -72,8 +72,6 @@ Display *dpy;
char *ProgName;
-unsigned int ValidModMask = 0xff;
-
struct WPreferences wPreferences;
WShortKey wKeyBindings[WKBD_LAST];
@@ -537,6 +535,7 @@ int main(int argc, char **argv)
w_global.program.signal_state = WSTATE_NORMAL;
w_global.timestamp.last_event = CurrentTime;
w_global.timestamp.focus_change = CurrentTime;
+ w_global.shortcut.modifiers_mask = 0xff;
/* setup common stuff for the monitor and wmaker itself */
WMInitializeApplication("WindowMaker", &argc, argv);
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 22bc21c..72ae878 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -350,7 +350,7 @@ Bool wRootMenuPerformShortcut(XEvent * event)
int done = 0;
/* ignore CapsLock */
- modifiers = event->xkey.state & ValidModMask;
+ modifiers = event->xkey.state & w_global.shortcut.modifiers_mask;
for (ptr = shortcutList; ptr != NULL; ptr = ptr->next) {
if (ptr->keycode == 0 || ptr->menu->menu->screen_ptr != scr)
diff --git a/src/startup.c b/src/startup.c
index a15190d..c6438ea 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -418,13 +418,13 @@ void StartUp(Bool defaultScreenOnly)
/*
* Ignore CapsLock in modifiers
*/
- ValidModMask = 0xff & ~LockMask;
+ w_global.shortcut.modifiers_mask = 0xff & ~LockMask;
getOffendingModifiers();
/*
* Ignore NumLock and ScrollLock too
*/
- ValidModMask &= ~(_NumLockMask | _ScrollLockMask);
+ w_global.shortcut.modifiers_mask &= ~(_NumLockMask | _ScrollLockMask);
memset(&wKeyBindings, 0, sizeof(wKeyBindings));
diff --git a/src/window.c b/src/window.c
index d1d7a5d..7b3cda2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2680,7 +2680,7 @@ static void resizebarMouseDown(WCoreWindow *sender, void
*data, XEvent *event)
}
#endif
- event->xbutton.state &= ValidModMask;
+ event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr);
@@ -2714,7 +2714,7 @@ static void titlebarDblClick(WCoreWindow *sender, void
*data, XEvent *event)
{
WWindow *wwin = data;
- event->xbutton.state &= ValidModMask;
+ event->xbutton.state &= w_global.shortcut.modifiers_mask;
if (event->xbutton.button == Button1) {
if (event->xbutton.state == 0) {
@@ -2778,7 +2778,7 @@ static void frameMouseDown(WObjDescriptor *desc, XEvent
*event)
resize_height_increment = wPreferences.resize_increment;
}
- event->xbutton.state &= ValidModMask;
+ event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr);
@@ -2834,7 +2834,7 @@ static void titlebarMouseDown(WCoreWindow *sender, void
*data, XEvent *event)
wwarning(_("The NumLock, ScrollLock or similar key seems to be
turned on. "
"Turn it off or some mouse actions and keyboard
shortcuts will not work."));
#endif
- event->xbutton.state &= ValidModMask;
+ event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr);
@@ -2892,7 +2892,7 @@ static void windowCloseClick(WCoreWindow *sender, void
*data, XEvent *event)
{
WWindow *wwin = data;
- event->xbutton.state &= ValidModMask;
+ event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr);
@@ -2955,7 +2955,7 @@ static void windowIconifyClick(WCoreWindow *sender, void
*data, XEvent *event)
{
WWindow *wwin = data;
- event->xbutton.state &= ValidModMask;
+ event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr);
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 5 +++++
src/WindowMaker.h | 16 ++++++++++++++--
src/appicon.c | 7 ++-----
src/cycling.c | 4 +---
src/defaults.c | 53 ++++++++++++++++++++++++-----------------------------
src/dialog.c | 2 --
src/event.c | 4 +---
src/keybind.h | 6 ++++++
src/main.c | 8 +-------
src/rootmenu.c | 13 ++++++-------
src/screen.c | 7 +------
src/startup.c | 26 ++++++++++----------------
src/wdefaults.c | 35 ++++++++++++++++-------------------
src/window.c | 14 ++++++--------
src/winmenu.c | 3 ---
src/winspector.c | 4 +---
src/workspace.c | 1 -
17 files changed, 94 insertions(+), 114 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].