diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 5447eb83..bcd128d2 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 ef8e7b96..992078a4 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 19934cd1..a68e6191 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 d74f7ad0..32620af9 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 cc7538af..bbf57c04 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 3e5b70d5..80724636 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