mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 05:18:06 +01:00
wmaker: moved the variable 'process_workspacemap_event' to the global namespace
The definition in the local header was not correct; it works because gcc is tolerant to this kind of errors but other compilers are not. The declaration was creating a local variable in each file that call header, and because it is not static gcc's linker will merge them. Other compilers will at best complain for duplicate symbol, and at worst silently duplicate the variable so it will not work as expected. The variable is now moved to the existing structure meant for global variables, so now the code is really clear about using a global variable instead of a static/local one. Took opportunity to add some missing 'static' attributes to some variables. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
41745d98d4
commit
ad84a2dc8f
14
src/wsmap.c
14
src/wsmap.c
@@ -46,9 +46,9 @@ static const int mini_workspace_per_line = 5;
|
||||
* will be 0 for workspaces number 0 to 9
|
||||
* 1 for workspaces number 10 -> 19
|
||||
*/
|
||||
int wsmap_bulk_index;
|
||||
WMPixmap *frame_bg_focused;
|
||||
WMPixmap *frame_bg_unfocused;
|
||||
static int wsmap_bulk_index;
|
||||
static WMPixmap *frame_bg_focused;
|
||||
static WMPixmap *frame_bg_unfocused;
|
||||
|
||||
typedef struct {
|
||||
WScreen *scr;
|
||||
@@ -147,7 +147,7 @@ static void selected_workspace_callback(WMWidget *w, void *data)
|
||||
int workspace_id = atoi(WMGetButtonText(click_button));
|
||||
|
||||
wWorkspaceChange(wsmap->scr, workspace_id);
|
||||
process_workspacemap_event = False;
|
||||
w_global.process_workspacemap_event = False;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,8 +482,8 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array)
|
||||
ButtonMotionMask | ButtonReleaseMask | ButtonPressMask,
|
||||
GrabModeAsync, GrabModeAsync, WMWidgetXID(wsmap->win), None, CurrentTime);
|
||||
|
||||
process_workspacemap_event = True;
|
||||
while (process_workspacemap_event) {
|
||||
w_global.process_workspacemap_event = True;
|
||||
while (w_global.process_workspacemap_event) {
|
||||
WMMaskEvent(dpy, KeyPressMask | KeyReleaseMask | ExposureMask
|
||||
| PointerMotionMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask, &ev);
|
||||
|
||||
@@ -496,7 +496,7 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array)
|
||||
if (ev.xkey.keycode == escKey || (wKeyBindings[WKBD_WORKSPACEMAP].keycode != 0 &&
|
||||
wKeyBindings[WKBD_WORKSPACEMAP].keycode == ev.xkey.keycode &&
|
||||
wKeyBindings[WKBD_WORKSPACEMAP].modifier == modifiers)) {
|
||||
process_workspacemap_event = False;
|
||||
w_global.process_workspacemap_event = False;
|
||||
} else {
|
||||
KeySym ks;
|
||||
int bulk_id;
|
||||
|
||||
Reference in New Issue
Block a user