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 01467300f870baa47686ec2c288d34bb925c58a7 (commit)
via 1fe265e72834f71b6f707968efcfc2fa35b312dc (commit)
via 4e5673f3fda01e2663bc1123df4078d159e4ea18 (commit)
via fb54d3f3ef658ce55b45fce46108bc0e595a5ce7 (commit)
via 967d4fd8ff62fdbe554fac3db2bc07d712a2c5b7 (commit)
via 25715c6d820a372d6b5386a35a6eac7bcc9e8e16 (commit)
via b6423a7b4f0111f73690d2a99ca0433d30b5dd32 (commit)
from 6d65daf1be2d93dabf32dd3c8aa9ce3b7d6cd481 (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/01467300f870baa47686ec2c288d34bb925c58a7
commit 01467300f870baa47686ec2c288d34bb925c58a7
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:27 2013 +0200
wmaker: Removed global variable 'WDelayedActionSet' and associated dead code
The variable's value was set to 0 but never changed afterwards, so
the function using it would never do anything.
diff --git a/src/main.c b/src/main.c
index bddffac..21e9469 100644
--- a/src/main.c
+++ b/src/main.c
@@ -83,9 +83,6 @@ WDDomain *WDWindowMaker = NULL;
WDDomain *WDWindowAttributes = NULL;
WDDomain *WDRootMenu = NULL;
-/* special flags */
-char WDelayedActionSet = 0;
-
/* notifications */
const char WMNManaged[] = "WMNManaged";
const char WMNUnmanaged[] = "WMNUnmanaged";
diff --git a/src/startup.c b/src/startup.c
index 8072463..a15190d 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -90,11 +90,6 @@ extern WDDomain *WDRootMenu;
extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST];
-#ifndef HAVE_INOTIFY
-/* special flags */
-extern char WDelayedActionSet;
-#endif
-
/***** Local *****/
static WScreen **wScreen = NULL;
static unsigned int _NumLockMask = 0;
@@ -143,28 +138,6 @@ static int handleXIO(Display * xio_dpy)
return 0;
}
-#ifndef HAVE_INOTIFY
-/*
- *----------------------------------------------------------------------
- * delayedAction-
- * Action to be executed after the signal() handler is exited.
- *----------------------------------------------------------------------
- */
-static void delayedAction(void *cdata)
-{
- if (WDelayedActionSet == 0)
- return;
-
- WDelayedActionSet--;
- /*
- * Make the event dispatcher do whatever it needs to do,
- * including handling zombie processes, restart and exit
- * signals.
- */
- DispatchEvent(NULL);
-}
-#endif
-
/*
*----------------------------------------------------------------------
* handleExitSig--
@@ -528,12 +501,6 @@ void StartUp(Bool defaultScreenOnly)
wPreferences.cursor[WCUR_EMPTY] = XCreatePixmapCursor(dpy, cur, cur,
&black, &black, 0, 0);
XFreePixmap(dpy, cur);
-
-#ifndef HAVE_INOTIFY
- /* signal handler stuff that gets called when a signal is caught */
- WMAddPersistentTimerHandler(500, delayedAction, NULL);
-#endif
-
/* emergency exit... */
sig_action.sa_handler = handleSig;
sigemptyset(&sig_action.sa_mask);
http://repo.or.cz/w/wmaker-crm.git/commit/1fe265e72834f71b6f707968efcfc2fa35b312dc
commit 1fe265e72834f71b6f707968efcfc2fa35b312dc
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:26 2013 +0200
wmaker: Moved variables for Inotify into the global namespace
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index bcd128d..27003d0 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -522,6 +522,13 @@ extern struct wmaker_global_variables {
struct WMenu *drawer_menu; /* menu for the drawers */
} dock;
+#ifdef HAVE_INOTIFY
+ struct {
+ int fd_event_queue; /* Inotify's queue file descriptor */
+ int wd_defaults; /* Watch Descriptor for the 'Defaults'
configuration file */
+ } inotify;
+#endif
+
/* definition for X Atoms */
struct {
diff --git a/src/event.c b/src/event.c
index a68e619..8629c6c 100644
--- a/src/event.c
+++ b/src/event.c
@@ -358,13 +358,11 @@ noreturn void EventLoop(void)
{
XEvent event;
#ifdef HAVE_INOTIFY
- extern int inotifyFD;
- extern int inotifyWD;
struct timeval time;
fd_set rfds;
int retVal = 0;
- if (inotifyFD < 0 || inotifyWD < 0)
+ if (w_global.inotify.fd_event_queue < 0 || w_global.inotify.wd_defaults
< 0)
retVal = -1;
#endif
@@ -377,20 +375,21 @@ noreturn void EventLoop(void)
time.tv_sec = 0;
time.tv_usec = 0;
FD_ZERO(&rfds);
- FD_SET(inotifyFD, &rfds);
+ FD_SET(w_global.inotify.fd_event_queue, &rfds);
/* check for available read data from inotify - don't
block! */
- retVal = select(inotifyFD + 1, &rfds, NULL, NULL,
&time);
+ retVal = select(w_global.inotify.fd_event_queue + 1,
&rfds, NULL, NULL, &time);
if (retVal < 0) { /* an error has occured */
wwarning(_("select failed. The inotify instance
will be closed."
" Changes to the defaults database
will require"
" a restart to take effect."));
- close(inotifyFD);
+ close(w_global.inotify.fd_event_queue);
+ w_global.inotify.fd_event_queue = -1;
continue;
}
- if (FD_ISSET(inotifyFD, &rfds))
- handle_inotify_events(inotifyFD, inotifyWD);
+ if (FD_ISSET(w_global.inotify.fd_event_queue, &rfds))
+
handle_inotify_events(w_global.inotify.fd_event_queue,
w_global.inotify.wd_defaults);
}
#endif
}
diff --git a/src/main.c b/src/main.c
index f4c6d1a..bddffac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,11 +74,6 @@ char *ProgName;
unsigned int ValidModMask = 0xff;
-#ifdef HAVE_INOTIFY
-int inotifyFD;
-int inotifyWD;
-#endif
-
struct WPreferences wPreferences;
WShortKey wKeyBindings[WKBD_LAST];
@@ -474,8 +469,9 @@ static void check_defaults(void)
static void inotifyWatchConfig(void)
{
char *watchPath = NULL;
- inotifyFD = inotify_init(); /* Initialise an inotify instance */
- if (inotifyFD < 0) {
+
+ w_global.inotify.fd_event_queue = inotify_init(); /* Initialise
an inotify instance */
+ if (w_global.inotify.fd_event_queue < 0) {
wwarning(_("could not initialise an inotify instance."
" Changes to the defaults database will require"
" a restart to take effect. Check your kernel!"));
@@ -485,12 +481,13 @@ static void inotifyWatchConfig(void)
* but we might want more in the future so check all events for
now.
* The individual events are checked for in event.c.
*/
- inotifyWD = inotify_add_watch(inotifyFD, watchPath,
IN_ALL_EVENTS);
- if (inotifyWD < 0) {
+ w_global.inotify.wd_defaults =
inotify_add_watch(w_global.inotify.fd_event_queue, watchPath, IN_ALL_EVENTS);
+ if (w_global.inotify.wd_defaults < 0) {
wwarning(_("could not add an inotify watch on path %s."
"Changes to the defaults database will
require"
" a restart to take effect."), watchPath);
- close(inotifyFD);
+ close(w_global.inotify.fd_event_queue);
+ w_global.inotify.fd_event_queue = -1;
}
}
wfree(watchPath);
diff --git a/src/shutdown.c b/src/shutdown.c
index e6d3503..300a269 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -54,9 +54,6 @@ static void wipeDesktop(WScreen * scr);
void Shutdown(WShutdownMode mode)
{
int i;
-#ifdef HAVE_INOTIFY
- extern int inotifyFD;
-#endif
switch (mode) {
case WSLogoutMode:
@@ -65,7 +62,10 @@ void Shutdown(WShutdownMode mode)
/* if there is no session manager, send SAVE_YOURSELF to
* the clients */
#ifdef HAVE_INOTIFY
- close(inotifyFD);
+ if (w_global.inotify.fd_event_queue >= 0) {
+ close(w_global.inotify.fd_event_queue);
+ w_global.inotify.fd_event_queue = -1;
+ }
#endif
for (i = 0; i < w_global.screen_count; i++) {
WScreen *scr;
@@ -92,7 +92,10 @@ void Shutdown(WShutdownMode mode)
WScreen *scr;
#ifdef HAVE_INOTIFY
- close(inotifyFD);
+ if (w_global.inotify.fd_event_queue >= 0) {
+ close(w_global.inotify.fd_event_queue);
+ w_global.inotify.fd_event_queue = -1;
+ }
#endif
scr = wScreenWithNumber(i);
if (scr) {
http://repo.or.cz/w/wmaker-crm.git/commit/4e5673f3fda01e2663bc1123df4078d159e4ea18
commit 4e5673f3fda01e2663bc1123df4078d159e4ea18
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:25 2013 +0200
wmaker: Moved variables for the XRandR extension into the global namespace
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 5447eb8..bcd128d 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -586,6 +586,13 @@ extern struct wmaker_global_variables {
} xkb;
#endif
+#ifdef HAVE_XRANDR
+ struct {
+ Bool supported;
+ int event_base;
+ } randr;
+#endif
+
/*
* If no extension were activated, we would end up with an empty
* structure, which old compilers may not appreciate, so let's
diff --git a/src/dialog.c b/src/dialog.c
index ef8e7b9..992078a 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1280,7 +1280,7 @@ void wShowInfoPanel(WScreen * scr)
#ifdef HAVE_XRANDR
strbuf = wstrappend(strbuf, ", XRandR ");
- if (has_randr)
+ if (w_global.xext.randr.supported)
strbuf = wstrappend(strbuf, _("(Supported)"));
else
strbuf = wstrappend(strbuf, _("(Unsupported)"));
diff --git a/src/event.c b/src/event.c
index 19934cd..a68e619 100644
--- a/src/event.c
+++ b/src/event.c
@@ -552,7 +552,7 @@ static void handleExtensions(XEvent * event)
}
#endif /*KEEP_XKB_LOCK_STATUS */
#ifdef HAVE_XRANDR
- if (has_randr && event->type == (randr_event_base +
RRScreenChangeNotify)) {
+ if (w_global.xext.randr.supported && event->type ==
(w_global.xext.randr.event_base + RRScreenChangeNotify)) {
/* From xrandr man page: "Clients must call back into Xlib using
* XRRUpdateConfiguration when screen configuration change
notify
* events are generated */
diff --git a/src/screen.c b/src/screen.c
index d74f7ad..32620af 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -71,11 +71,6 @@
/**** Global variables ****/
-#ifdef HAVE_XRANDR
-Bool has_randr;
-int randr_event_base;
-#endif
-
extern WDDomain *WDWindowMaker;
/**** Local ****/
@@ -550,7 +545,7 @@ WScreen *wScreenInit(int screen_number)
#endif /* KEEP_XKB_LOCK_STATUS */
#ifdef HAVE_XRANDR
- if (has_randr)
+ if (w_global.xext.randr.supported)
XRRSelectInput(dpy, scr->root_win, RRScreenChangeNotifyMask);
#endif
diff --git a/src/screen.h b/src/screen.h
index cc7538a..bbf57c0 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -35,11 +35,6 @@
#define WTB_PFOCUSED 4
#define WTB_MENU 6
-#ifdef HAVE_XRANDR
-extern Bool has_randr;
-extern int randr_event_base;
-#endif
-
typedef struct {
WMRect *screens;
int count; /* screen count, 0 = inactive */
diff --git a/src/startup.c b/src/startup.c
index 3e5b70d..8072463 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -627,7 +627,7 @@ void StartUp(Bool defaultScreenOnly)
#endif
#ifdef HAVE_XRANDR
- has_randr = XRRQueryExtension(dpy, &randr_event_base, &dummy);
+ w_global.xext.randr.supported = XRRQueryExtension(dpy,
&w_global.xext.randr.event_base, &dummy);
#endif
#ifdef KEEP_XKB_LOCK_STATUS
http://repo.or.cz/w/wmaker-crm.git/commit/fb54d3f3ef658ce55b45fce46108bc0e595a5ce7
commit fb54d3f3ef658ce55b45fce46108bc0e595a5ce7
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:24 2013 +0200
wmaker: Moved variables for the Xkb extension into the global namespace
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index da8093d..5447eb8 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -579,6 +579,13 @@ extern struct wmaker_global_variables {
} shape;
#endif
+#ifdef KEEP_XKB_LOCK_STATUS
+ struct {
+ Bool supported;
+ int event_base;
+ } xkb;
+#endif
+
/*
* If no extension were activated, we would end up with an empty
* structure, which old compilers may not appreciate, so let's
diff --git a/src/event.c b/src/event.c
index 3968639..19934cd 100644
--- a/src/event.c
+++ b/src/event.c
@@ -81,10 +81,6 @@ extern WShortKey wKeyBindings[WKBD_LAST];
#define MOD_MASK wPreferences.modifier_mask
-#ifdef KEEP_XKB_LOCK_STATUS
-extern int wXkbEventBase;
-#endif
-
/************ Local stuff ***********/
static void saveTimestamp(XEvent *event);
@@ -551,7 +547,7 @@ static void handleExtensions(XEvent * event)
}
#endif
#ifdef KEEP_XKB_LOCK_STATUS
- if (wPreferences.modelock && (xkbevent->type == wXkbEventBase)) {
+ if (wPreferences.modelock && (xkbevent->type ==
w_global.xext.xkb.event_base)) {
handleXkbIndicatorStateNotify(event);
}
#endif /*KEEP_XKB_LOCK_STATUS */
diff --git a/src/main.c b/src/main.c
index 2cf91b3..f4c6d1a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -88,11 +88,6 @@ WDDomain *WDWindowMaker = NULL;
WDDomain *WDWindowAttributes = NULL;
WDDomain *WDRootMenu = NULL;
-#ifdef KEEP_XKB_LOCK_STATUS
-Bool wXkbSupported;
-int wXkbEventBase;
-#endif
-
/* special flags */
char WDelayedActionSet = 0;
diff --git a/src/screen.c b/src/screen.c
index 18c76f5..d74f7ad 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -71,10 +71,6 @@
/**** Global variables ****/
-#ifdef KEEP_XKB_LOCK_STATUS
-extern int wXkbSupported;
-#endif
-
#ifdef HAVE_XRANDR
Bool has_randr;
int randr_event_base;
@@ -548,7 +544,7 @@ WScreen *wScreenInit(int screen_number)
/* Only GroupLock doesn't work correctly in my system since right-alt
* can change mode while holding it too - ]d
*/
- if (wXkbSupported) {
+ if (w_global.xext.xkb.supported) {
XkbSelectEvents(dpy, XkbUseCoreKbd, XkbStateNotifyMask,
XkbStateNotifyMask);
}
#endif /* KEEP_XKB_LOCK_STATUS */
diff --git a/src/startup.c b/src/startup.c
index 4d6799f..3e5b70d 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -90,11 +90,6 @@ extern WDDomain *WDRootMenu;
extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST];
-#ifdef KEEP_XKB_LOCK_STATUS
-extern Bool wXkbSupported;
-extern int wXkbEventBase;
-#endif
-
#ifndef HAVE_INOTIFY
/* special flags */
extern char WDelayedActionSet;
@@ -636,8 +631,8 @@ void StartUp(Bool defaultScreenOnly)
#endif
#ifdef KEEP_XKB_LOCK_STATUS
- wXkbSupported = XkbQueryExtension(dpy, NULL, &wXkbEventBase, NULL,
NULL, NULL);
- if (wPreferences.modelock && !wXkbSupported) {
+ w_global.xext.xkb.supported = XkbQueryExtension(dpy, NULL,
&w_global.xext.xkb.event_base, NULL, NULL, NULL);
+ if (wPreferences.modelock && !w_global.xext.xkb.supported) {
wwarning(_("XKB is not supported. KbdModeLock is automatically
disabled."));
wPreferences.modelock = 0;
}
http://repo.or.cz/w/wmaker-crm.git/commit/967d4fd8ff62fdbe554fac3db2bc07d712a2c5b7
commit 967d4fd8ff62fdbe554fac3db2bc07d712a2c5b7
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:23 2013 +0200
wmaker: Moved variables for the XShape extension into the global namespace
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index eb72dcc..da8093d 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -570,6 +570,23 @@ extern struct wmaker_global_variables {
XContext stack;
} context;
+ /* X Extensions */
+ struct {
+#ifdef SHAPE
+ struct {
+ Bool supported;
+ int event_base;
+ } shape;
+#endif
+
+ /*
+ * If no extension were activated, we would end up with an empty
+ * structure, which old compilers may not appreciate, so let's
+ * work around this with a simple:
+ */
+ int dummy;
+ } xext;
+
/* Session related */
WMPropList *session_state;
diff --git a/src/client.c b/src/client.c
index 6ec7458..05b1049 100644
--- a/src/client.c
+++ b/src/client.c
@@ -44,11 +44,6 @@
#include "wmspec.h"
#include "misc.h"
-/****** Global Variables ******/
-
-#ifdef SHAPE
-extern Bool wShapeSupported;
-#endif
/*
*--------------------------------------------------------------------
@@ -172,7 +167,7 @@ void wClientConfigure(WWindow * wwin,
XConfigureRequestEvent * xcre)
return;
}
#ifdef SHAPE
- if (wShapeSupported) {
+ if (w_global.xext.shape.supported) {
int junk;
unsigned int ujunk;
int b_shaped;
diff --git a/src/event.c b/src/event.c
index 780bab2..3968639 100644
--- a/src/event.c
+++ b/src/event.c
@@ -81,11 +81,6 @@ extern WShortKey wKeyBindings[WKBD_LAST];
#define MOD_MASK wPreferences.modifier_mask
-#ifdef SHAPE
-extern Bool wShapeSupported;
-extern int wShapeEventBase;
-#endif
-
#ifdef KEEP_XKB_LOCK_STATUS
extern int wXkbEventBase;
#endif
@@ -551,7 +546,7 @@ static void handleExtensions(XEvent * event)
xkbevent = (XkbEvent *) event;
#endif /*KEEP_XKB_LOCK_STATUS */
#ifdef SHAPE
- if (wShapeSupported && event->type == (wShapeEventBase + ShapeNotify)) {
+ if (w_global.xext.shape.supported && event->type ==
(w_global.xext.shape.event_base + ShapeNotify)) {
handleShapeNotify(event);
}
#endif
diff --git a/src/main.c b/src/main.c
index 8924a5d..2cf91b3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -88,11 +88,6 @@ WDDomain *WDWindowMaker = NULL;
WDDomain *WDWindowAttributes = NULL;
WDDomain *WDRootMenu = NULL;
-#ifdef SHAPE
-Bool wShapeSupported;
-int wShapeEventBase;
-#endif
-
#ifdef KEEP_XKB_LOCK_STATUS
Bool wXkbSupported;
int wXkbEventBase;
diff --git a/src/startup.c b/src/startup.c
index eaa8634..4d6799f 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -90,11 +90,6 @@ extern WDDomain *WDRootMenu;
extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST];
-#ifdef SHAPE
-extern Bool wShapeSupported;
-extern int wShapeEventBase;
-#endif
-
#ifdef KEEP_XKB_LOCK_STATUS
extern Bool wXkbSupported;
extern int wXkbEventBase;
@@ -633,7 +628,7 @@ void StartUp(Bool defaultScreenOnly)
#ifdef SHAPE
/* ignore j */
- wShapeSupported = XShapeQueryExtension(dpy, &wShapeEventBase, &j);
+ w_global.xext.shape.supported = XShapeQueryExtension(dpy,
&w_global.xext.shape.event_base, &j);
#endif
#ifdef HAVE_XRANDR
diff --git a/src/switchpanel.c b/src/switchpanel.c
index a0f2195..af32171 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -38,8 +38,6 @@
#ifdef SHAPE
#include <X11/extensions/shape.h>
-
-extern Bool wShapeSupported;
#endif
struct SwitchPanel {
@@ -522,7 +520,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow
*curwin, Bool class_only)
XSetWindowBackgroundPixmap(dpy, WMWidgetXID(panel->win),
pixmap);
#ifdef SHAPE
- if (mask && wShapeSupported)
+ if (mask && w_global.xext.shape.supported)
XShapeCombineMask(dpy, WMWidgetXID(panel->win),
ShapeBounding, 0, 0, mask, ShapeSet);
#endif
if (pixmap)
diff --git a/src/window.c b/src/window.c
index be5af54..d1d7a5d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -75,10 +75,6 @@
/****** Global Variables ******/
extern WShortKey wKeyBindings[WKBD_LAST];
-#ifdef SHAPE
-extern Bool wShapeSupported;
-#endif
-
/***** Local Stuff *****/
static WWindowState *windowState = NULL;
static FocusMode getFocusMode(WWindow *wwin);
@@ -621,7 +617,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
XSaveContext(dpy, window, w_global.context.client_win, (XPointer) &
wwin->client_descriptor);
#ifdef SHAPE
- if (wShapeSupported) {
+ if (w_global.xext.shape.supported) {
int junk;
unsigned int ujunk;
int b_shaped;
@@ -2042,7 +2038,7 @@ void wWindowConfigure(WWindow *wwin, int req_x, int
req_y, int req_width, int re
wwin->client.y += wwin->screen_ptr->frame_border_width;
}
#ifdef SHAPE
- if (wShapeSupported && wwin->flags.shaped && resize)
+ if (w_global.xext.shape.supported && wwin->flags.shaped && resize)
wWindowSetShape(wwin);
#endif
@@ -2266,7 +2262,7 @@ void wWindowConfigureBorders(WWindow *wwin)
wFrameWindowHideButton(wwin->frame, flags);
#ifdef SHAPE
- if (wShapeSupported && wwin->flags.shaped)
+ if (w_global.xext.shape.supported && wwin->flags.shaped)
wWindowSetShape(wwin);
#endif
}
http://repo.or.cz/w/wmaker-crm.git/commit/25715c6d820a372d6b5386a35a6eac7bcc9e8e16
commit 25715c6d820a372d6b5386a35a6eac7bcc9e8e16
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:22 2013 +0200
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.
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/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;
http://repo.or.cz/w/wmaker-crm.git/commit/b6423a7b4f0111f73690d2a99ca0433d30b5dd32
commit b6423a7b4f0111f73690d2a99ca0433d30b5dd32
Author: Christophe CURIS <[email protected]>
Date: Thu Oct 10 20:38:21 2013 +0200
wmaker: Moved variable Screen Count into the global namespace
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index e31c9c3..c861a7d 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -481,6 +481,9 @@ extern struct wmaker_global_variables {
} timestamp;
+ /* Screens related */
+ int screen_count;
+
/* Workspace related */
struct {
struct WWorkspace **array; /* data for the workspaces */
diff --git a/src/defaults.c b/src/defaults.c
index b476c70..705142d 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -75,7 +75,6 @@
extern WDDomain *WDWindowMaker;
extern WDDomain *WDWindowAttributes;
extern WDDomain *WDRootMenu;
-extern int wScreenCount;
extern WShortKey wKeyBindings[WKBD_LAST];
typedef struct _WDefaultEntry WDefaultEntry;
@@ -995,7 +994,7 @@ void wDefaultsCheckDomains(void* arg)
shared_dict = NULL;
}
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
scr = wScreenWithNumber(i);
if (scr)
wReadDefaults(scr, dict);
@@ -1038,7 +1037,7 @@ void wDefaultsCheckDomains(void* arg)
WMReleasePropList(WDWindowAttributes->dictionary);
WDWindowAttributes->dictionary = dict;
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
scr = wScreenWithNumber(i);
if (scr) {
wDefaultUpdateIcons(scr);
diff --git a/src/event.c b/src/event.c
index a69be0d..780bab2 100644
--- a/src/event.c
+++ b/src/event.c
@@ -78,7 +78,6 @@
/******** Global Variables **********/
extern WShortKey wKeyBindings[WKBD_LAST];
-extern int wScreenCount;
#define MOD_MASK wPreferences.modifier_mask
@@ -1198,7 +1197,7 @@ static void handleXkbIndicatorStateNotify(XEvent *event)
XkbStateRec staterec;
int i;
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
scr = wScreenWithNumber(i);
wwin = scr->focused_window;
if (wwin && wwin->flags.focused) {
@@ -1697,17 +1696,17 @@ static void handleKeyPress(XEvent * event)
break;
case WKBD_SWITCH_SCREEN:
- if (wScreenCount > 1) {
+ if (w_global.screen_count > 1) {
WScreen *scr2;
int i;
/* find index of this screen */
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
if (wScreenWithNumber(i) == scr)
break;
}
i++;
- if (i >= wScreenCount) {
+ if (i >= w_global.screen_count) {
i = 0;
}
scr2 = wScreenWithNumber(i);
diff --git a/src/main.c b/src/main.c
index 5862389..8924a5d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -79,8 +79,6 @@ int inotifyFD;
int inotifyWD;
#endif
-int wScreenCount = 0;
-
struct WPreferences wPreferences;
WShortKey wKeyBindings[WKBD_LAST];
@@ -423,7 +421,7 @@ noreturn void wAbort(Bool dumpCore)
int i;
WScreen *scr;
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
scr = wScreenWithNumber(i);
if (scr)
RestoreDesktop(scr);
@@ -792,7 +790,7 @@ static int real_main(int argc, char **argv)
wXModifierInitialize();
StartUp(!multiHead);
- if (wScreenCount == 1)
+ if (w_global.screen_count == 1)
multiHead = False;
execInitScript();
diff --git a/src/screen.c b/src/screen.c
index 2ff3d9d..18c76f5 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -70,7 +70,6 @@
|KeyPressMask|KeyReleaseMask)
/**** Global variables ****/
-extern int wScreenCount;
#ifdef KEEP_XKB_LOCK_STATUS
extern int wXkbSupported;
@@ -804,7 +803,7 @@ void wScreenRestoreState(WScreen * scr)
make_keys();
- if (wScreenCount == 1) {
+ if (w_global.screen_count == 1) {
path = wdefaultspathfordomain("WMState");
} else {
char buf[16];
@@ -814,7 +813,7 @@ void wScreenRestoreState(WScreen * scr)
w_global.session_state = WMReadPropListFromFile(path);
wfree(path);
- if (!w_global.session_state && wScreenCount > 1) {
+ if (!w_global.session_state && w_global.screen_count > 1) {
path = wdefaultspathfordomain("WMState");
w_global.session_state = WMReadPropListFromFile(path);
wfree(path);
@@ -915,7 +914,7 @@ void wScreenSaveState(WScreen * scr)
wMenuSaveState(scr);
- if (wScreenCount == 1) {
+ if (w_global.screen_count == 1) {
str = wdefaultspathfordomain("WMState");
} else {
char buf[16];
diff --git a/src/shutdown.c b/src/shutdown.c
index 5a82292..e6d3503 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -38,7 +38,6 @@
#include "colormap.h"
#include "shutdown.h"
-extern int wScreenCount;
static void wipeDesktop(WScreen * scr);
@@ -68,7 +67,7 @@ void Shutdown(WShutdownMode mode)
#ifdef HAVE_INOTIFY
close(inotifyFD);
#endif
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
WScreen *scr;
scr = wScreenWithNumber(i);
@@ -89,7 +88,7 @@ void Shutdown(WShutdownMode mode)
break;
case WSRestartPreparationMode:
- for (i = 0; i < wScreenCount; i++) {
+ for (i = 0; i < w_global.screen_count; i++) {
WScreen *scr;
#ifdef HAVE_INOTIFY
diff --git a/src/startup.c b/src/startup.c
index 8a229aa..eaa8634 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -89,7 +89,6 @@ extern WDDomain *WDWindowMaker;
extern WDDomain *WDRootMenu;
extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST];
-extern int wScreenCount;
#ifdef SHAPE
extern Bool wShapeSupported;
@@ -371,7 +370,7 @@ wHackedGrabButton(unsigned int button, unsigned int
modifiers,
WScreen *wScreenWithNumber(int i)
{
- assert(i < wScreenCount);
+ assert(i < w_global.screen_count);
return wScreen[i];
}
@@ -380,13 +379,13 @@ WScreen *wScreenForRootWindow(Window window)
{
int i;
- if (wScreenCount == 1)
+ if (w_global.screen_count == 1)
return wScreen[0];
/* Since the number of heads will probably be small (normally 2),
* it should be faster to use this than a hash table, because
* of the overhead. */
- for (i = 0; i < wScreenCount; i++)
+ for (i = 0; i < w_global.screen_count; i++)
if (wScreen[i]->root_win == window)
return wScreen[i];
@@ -397,7 +396,7 @@ WScreen *wScreenForWindow(Window window)
{
XWindowAttributes attr;
- if (wScreenCount == 1)
+ if (w_global.screen_count == 1)
return wScreen[0];
if (XGetWindowAttributes(dpy, window, &attr))
@@ -656,7 +655,7 @@ void StartUp(Bool defaultScreenOnly)
wScreen = wmalloc(sizeof(WScreen *) * max);
- wScreenCount = 0;
+ w_global.screen_count = 0;
/* Check if TIFF images are supported */
formats = RSupportedFileFormats();
@@ -672,25 +671,25 @@ void StartUp(Bool defaultScreenOnly)
/* manage the screens */
for (j = 0; j < max; j++) {
if (defaultScreenOnly || max == 1) {
- wScreen[wScreenCount] = wScreenInit(DefaultScreen(dpy));
- if (!wScreen[wScreenCount]) {
+ wScreen[w_global.screen_count] =
wScreenInit(DefaultScreen(dpy));
+ if (!wScreen[w_global.screen_count]) {
wfatal(_("it seems that there is already a
window manager running"));
Exit(1);
}
} else {
- wScreen[wScreenCount] = wScreenInit(j);
- if (!wScreen[wScreenCount]) {
+ wScreen[w_global.screen_count] = wScreenInit(j);
+ if (!wScreen[w_global.screen_count]) {
wwarning(_("could not manage screen %i"), j);
continue;
}
}
- wScreenCount++;
+ w_global.screen_count++;
}
InitializeSwitchMenu();
/* initialize/restore state for the screens */
- for (j = 0; j < wScreenCount; j++) {
+ for (j = 0; j < w_global.screen_count; j++) {
int lastDesktop;
lastDesktop = wNETWMGetCurrentDesktopFromHint(wScreen[j]);
@@ -743,7 +742,7 @@ void StartUp(Bool defaultScreenOnly)
wSessionRestoreLastWorkspace(wScreen[j]);
}
- if (wScreenCount == 0) {
+ if (w_global.screen_count == 0) {
wfatal(_("could not manage any screen"));
Exit(1);
}
-----------------------------------------------------------------------
Summary of changes:
src/WindowMaker.h | 48 +++++++++++++++++++++++++++++++++
src/actions.c | 13 +++-----
src/client.c | 7 +----
src/defaults.c | 5 +--
src/dialog.c | 2 +-
src/event.c | 39 ++++++++++-----------------
src/main.c | 36 ++++++-------------------
src/screen.c | 20 +++----------
src/screen.h | 5 ---
src/shutdown.c | 18 +++++++-----
src/startup.c | 76 +++++++++++-----------------------------------------
src/switchpanel.c | 4 +--
src/window.c | 10 ++-----
src/workspace.c | 3 +-
14 files changed, 116 insertions(+), 170 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].