From: "Rodolfo García Peñas (kix)" <[email protected]>
This patch moves the XRANDR variable definitions to screen.h, because
xrandr is related to screen behavior. Then, the definition externs
can be removed.
This patch also changes (in event.c) the ConfigureNotify event processing
to avoid call the "if" block if XRANDR is not enabled. I chose the option of
move the if into the HAVE_XRANDR block instead of include the
ConfigureNotify case inside of the HAVE_XRANDR block (proposed by
BALATON Zoltan) to avoid call the default option if not needed.
---
src/event.c | 14 +++-----------
src/main.c | 5 -----
src/screen.c | 3 ---
src/screen.h | 4 ++++
src/startup.c | 5 -----
5 files changed, 7 insertions(+), 24 deletions(-)
diff --git a/src/event.c b/src/event.c
index 53d5acf..2ac11f3 100644
--- a/src/event.c
+++ b/src/event.c
@@ -68,6 +68,7 @@
#include "wmspec.h"
#include "rootmenu.h"
#include "colormap.h"
+#include "screen.h"
/******** Global Variables **********/
extern XContext wWinContext;
@@ -104,14 +105,6 @@ extern int wShapeEventBase;
extern int wXkbEventBase;
#endif
-#ifdef HAVE_XRANDR
-extern Bool has_randr;
-extern int randr_event_base;
-#endif
-
-/* special flags */
-/*extern char WDelayedActionSet;*/
-
/************ Local stuff ***********/
static void saveTimestamp(XEvent *event);
@@ -301,11 +294,10 @@ void DispatchEvent(XEvent * event)
break;
case ConfigureNotify:
- if (event->xconfigure.window == DefaultRootWindow(dpy)) {
#ifdef HAVE_XRANDR
- XRRUpdateConfiguration(event);
+ if (event->xconfigure.window == DefaultRootWindow(dpy))
+ XRRUpdateConfiguration(event);
#endif
- }
break;
default:
diff --git a/src/main.c b/src/main.c
index b09b6ef..51808b0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -139,11 +139,6 @@ Bool wXkbSupported;
int wXkbEventBase;
#endif
-#ifdef HAVE_XRANDR
-Bool has_randr;
-int randr_event_base;
-#endif
-
/* special flags */
char WProgramSigState = 0;
char WProgramState = WSTATE_NORMAL;
diff --git a/src/screen.c b/src/screen.c
index ecdb498..bc8f3fa 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -80,9 +80,6 @@ extern int wScreenCount;
#ifdef KEEP_XKB_LOCK_STATUS
extern int wXkbSupported;
#endif
-#ifdef HAVE_XRANDR
-extern int has_randr;
-#endif
extern WDDomain *WDWindowMaker;
diff --git a/src/screen.h b/src/screen.h
index dfdbd63..52a0c42 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -35,6 +35,10 @@
#define WTB_PFOCUSED 4
#define WTB_MENU 6
+#ifdef HAVE_XRANDR
+Bool has_randr;
+int randr_event_base;
+#endif
typedef struct {
WMRect *screens;
diff --git a/src/startup.c b/src/startup.c
index ac7baa4..e140026 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -99,11 +99,6 @@ extern Bool wXkbSupported;
extern int wXkbEventBase;
#endif
-#ifdef HAVE_XRANDR
-extern Bool has_randr;
-extern int randr_event_base;
-#endif
-
/* contexts */
extern XContext wWinContext;
extern XContext wAppWinContext;
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].