From 73c00fac274991ce479445f525ba20090aa92e2c Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 17 Nov 2013 18:51:17 +0100 Subject: [PATCH] Code refactoring: replaced macro 'HAVE_XRANDR' by 'USE_XRANDR' for consistency The usual way to define a macro in is to name macro with 'USE_xxx' when they are used to enable a feature 'xxx'. Signed-off-by: Christophe CURIS --- configure.ac | 2 +- src/WindowMaker.h | 2 +- src/dialog.c | 2 +- src/event.c | 6 +++--- src/screen.c | 4 ++-- src/startup.c | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index e5fad665..4f9cf6a9 100644 --- a/configure.ac +++ b/configure.ac @@ -520,7 +520,7 @@ LIBXRANDR= if test "$xrandr" = yes; then AC_CHECK_LIB(Xrandr, XRRQueryExtension, [LIBXRANDR=-lXrandr added_xext=yes - AC_DEFINE(HAVE_XRANDR, 1, [define if you want support for XRandR (set by configure)])], + AC_DEFINE(USE_XRANDR, 1, [define if you want support for XRandR (set by configure)])], xrandr=no, $XLFLAGS $XLIBS) fi AC_SUBST(LIBXRANDR) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 0fb67e3b..f11dab60 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -600,7 +600,7 @@ extern struct wmaker_global_variables { } xkb; #endif -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR struct { Bool supported; int event_base; diff --git a/src/dialog.c b/src/dialog.c index 63b8c505..43f12fcb 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1292,7 +1292,7 @@ void wShowInfoPanel(WScreen *scr) strbuf = wstrappend(strbuf, _("\nAdditional support for: ")); strbuf = wstrappend(strbuf, "WMSPEC"); -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR strbuf = wstrappend(strbuf, ", XRandR "); if (w_global.xext.randr.supported) strbuf = wstrappend(strbuf, _("(Supported)")); diff --git a/src/event.c b/src/event.c index da75cf30..acb7e1f0 100644 --- a/src/event.c +++ b/src/event.c @@ -42,7 +42,7 @@ #include "xdnd.h" #endif -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR #include #endif @@ -265,7 +265,7 @@ void DispatchEvent(XEvent * event) break; case ConfigureNotify: -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR if (event->xconfigure.window == DefaultRootWindow(dpy)) XRRUpdateConfiguration(event); #endif @@ -557,7 +557,7 @@ static void handleExtensions(XEvent * event) handleXkbIndicatorStateNotify(event); } #endif /*KEEP_XKB_LOCK_STATUS */ -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR 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 diff --git a/src/screen.c b/src/screen.c index 52c164ad..3735fc04 100644 --- a/src/screen.c +++ b/src/screen.c @@ -31,7 +31,7 @@ #ifdef KEEP_XKB_LOCK_STATUS #include #endif /* KEEP_XKB_LOCK_STATUS */ -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR #include #endif @@ -540,7 +540,7 @@ WScreen *wScreenInit(int screen_number) } #endif /* KEEP_XKB_LOCK_STATUS */ -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR if (w_global.xext.randr.supported) XRRSelectInput(dpy, scr->root_win, RRScreenChangeNotifyMask); #endif diff --git a/src/startup.c b/src/startup.c index 581b6449..6ede6f58 100644 --- a/src/startup.c +++ b/src/startup.c @@ -44,7 +44,7 @@ #ifdef KEEP_XKB_LOCK_STATUS #include #endif -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR #include #endif @@ -592,7 +592,7 @@ void StartUp(Bool defaultScreenOnly) w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j); #endif -#ifdef HAVE_XRANDR +#ifdef USE_XRANDR w_global.xext.randr.supported = XRRQueryExtension(dpy, &w_global.xext.randr.event_base, &j); #endif -- 2.11.4.GIT