1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: Moved variable Ignore Wks Change into the workspace object in the global namespace

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.
This commit is contained in:
Christophe CURIS
2013-10-10 20:38:22 +02:00
committed by Carlos R. Mafra
parent b6423a7b4f
commit c3c2d8d7f1
4 changed files with 14 additions and 10 deletions

View File

@@ -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 */

View File

@@ -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)

View File

@@ -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);

View File

@@ -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;