diff --git a/src/WindowMaker.h b/src/WindowMaker.h index ce0a86c9..2d9ed1af 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -522,6 +522,13 @@ extern struct wmaker_global_variables { */ Bool ignore_workspace_change; + /* + * Process WorkspaceMap Event: + * this variable is set when the Workspace Map window is being displayed, + * it is mainly used to avoid re-opening another one at the same time + */ + Bool process_workspacemap_event; + #ifdef HAVE_INOTIFY struct { int fd_event_queue; /* Inotify's queue file descriptor */ diff --git a/src/workspace.c b/src/workspace.c index 165e3011..9a820574 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -476,7 +476,7 @@ void wWorkspaceForceChange(WScreen * scr, int workspace) if (workspace >= MAX_WORKSPACES || workspace < 0) return; - if (!wPreferences.disable_workspace_pager && !process_workspacemap_event) + if (!wPreferences.disable_workspace_pager && !w_global.process_workspacemap_event) wWorkspaceMapUpdate(scr); SendHelperMessage(scr, 'C', workspace + 1, NULL); diff --git a/src/wsmap.c b/src/wsmap.c index 244df94b..ee667f9f 100755 --- a/src/wsmap.c +++ b/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; diff --git a/src/wsmap.h b/src/wsmap.h index 2133bd52..27a45cc4 100644 --- a/src/wsmap.h +++ b/src/wsmap.h @@ -20,8 +20,6 @@ #ifndef WSMAP_H #define WSMAP_H -Bool process_workspacemap_event; - void wWorkspaceMapUpdate(WScreen *scr); void StartWorkspaceMap(WScreen *scr);