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

wmaker: Moved variables for the XRandR extension into the global namespace

This commit is contained in:
Christophe CURIS
2013-10-10 20:38:25 +02:00
committed by Carlos R. Mafra
parent 3995130b79
commit 6dcfdd072b
6 changed files with 11 additions and 14 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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