From: Christophe CURIS <[email protected]>

---
 src/WindowMaker.h | 7 +++++++
 src/dialog.c      | 2 +-
 src/event.c       | 2 +-
 src/screen.c      | 7 +------
 src/screen.h      | 5 -----
 src/startup.c     | 2 +-
 6 files changed, 11 insertions(+), 14 deletions(-)

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
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to