From: Christophe CURIS <[email protected]>
Took the opportunity to change its type: it was an integer, but it is
actually holding a yes/no status, so it is now defined as a boolean.
---
src/WindowMaker.h | 7 +++++++
src/actions.c | 13 +++++--------
src/main.c | 1 +
src/workspace.c | 3 +--
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index c861a7d..eb72dcc 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -494,6 +494,13 @@ extern struct wmaker_global_variables {
WMFont *font_for_name; /* used during workspace switch */
+ /*
+ * Ignore Workspace Change:
+ * this variable is used to prevent workspace switch while
certain
+ * operations are ongoing.
+ */
+ Bool ignore_change;
+
/* Menus */
struct WMenu *menu; /* workspace operation */
struct WMenu *submenu; /* workspace list for window_menu */
diff --git a/src/actions.c b/src/actions.c
index 1b351f4..65eaa84 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -50,9 +50,6 @@
#include "misc.h"
#include "event.h"
-/****** Global Variables ******/
-
-int ignore_wks_change = 0;
static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x,
int *new_y,
unsigned int *new_width, unsigned int
*new_height);
@@ -1199,7 +1196,7 @@ void wIconifyWindow(WWindow * wwin)
void wDeiconifyWindow(WWindow *wwin)
{
/* Let's avoid changing workspace while deiconifying */
- ignore_wks_change = 1;
+ w_global.workspace.ignore_change = True;
/* we're hiding for show_desktop */
int netwm_hidden = wwin->flags.net_show_desktop &&
@@ -1209,7 +1206,7 @@ void wDeiconifyWindow(WWindow *wwin)
wWindowChangeWorkspace(wwin, w_global.workspace.current);
if (!wwin->flags.miniaturized) {
- ignore_wks_change = 0;
+ w_global.workspace.ignore_change = False;
return;
}
@@ -1220,7 +1217,7 @@ void wDeiconifyWindow(WWindow *wwin)
wDeiconifyWindow(owner);
wSetFocusTo(wwin->screen_ptr, wwin);
wRaiseFrame(wwin->frame->core);
- ignore_wks_change = 0;
+ w_global.workspace.ignore_change = False;
return;
}
}
@@ -1309,7 +1306,7 @@ void wDeiconifyWindow(WWindow *wwin)
/* the window can disappear while
ProcessPendingEvents() runs */
if (!wWindowFor(clientwin)) {
- ignore_wks_change = 0;
+ w_global.workspace.ignore_change = False;
return;
}
}
@@ -1325,7 +1322,7 @@ void wDeiconifyWindow(WWindow *wwin)
if (!netwm_hidden)
wUnshadeWindow(wwin);
- ignore_wks_change = 0;
+ w_global.workspace.ignore_change = False;
}
static void hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int
animate)
diff --git a/src/main.c b/src/main.c
index 8924a5d..79899a0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -553,6 +553,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.workspace.ignore_change = False;
/* setup common stuff for the monitor and wmaker itself */
WMInitializeApplication("WindowMaker", &argc, argv);
diff --git a/src/workspace.c b/src/workspace.c
index d959663..9455691 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 int ignore_wks_change;
extern WShortKey wKeyBindings[WKBD_LAST];
static WMPropList *dWorkspaces = NULL;
@@ -441,7 +440,7 @@ void wWorkspaceRelativeChange(WScreen * scr, int amount)
* still "flying" to its final position and we don't want to
* change workspace before the animation finishes, otherwise
* the window will land in the new workspace */
- if (ignore_wks_change)
+ if (w_global.workspace.ignore_change)
return;
w = w_global.workspace.current + amount;
--
1.8.4.rc3
--
To unsubscribe, send mail to [email protected].