mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
wmaker: Moved variables for the XRandR extension into the global namespace
This commit is contained in:
committed by
Carlos R. Mafra
parent
3995130b79
commit
6dcfdd072b
@@ -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
|
||||
|
||||
@@ -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)"));
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user