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

RandR misc.

This patch is replacing XRandR naming to RandR,
as XRandR is the name of the tool used in X11 and RandR
is the technology WMaker wants to support.
I had to update the info panel too, when many features are
activated not all of them can be displayed properly.
This commit is contained in:
David Maciejak
2014-03-13 23:48:10 +08:00
committed by Carlos R. Mafra
parent afc900a7c3
commit c2e4f62777
7 changed files with 27 additions and 25 deletions

View File

@@ -526,14 +526,14 @@ AC_ARG_ENABLE([xinerama],
[enable_xinerama=auto]) [enable_xinerama=auto])
WM_XEXT_CHECK_XINERAMA WM_XEXT_CHECK_XINERAMA
dnl XRandR support dnl RandR support
dnl ============== dnl ==============
AC_ARG_ENABLE([xrandr], AC_ARG_ENABLE([randr],
[AS_HELP_STRING([--enable-xrandr], [enable XRandR extension support (NOT recommended, buggy)])], [AS_HELP_STRING([--enable-randr], [enable RandR extension support (NOT recommended, buggy)])],
[AS_CASE(["$enableval"], [AS_CASE(["$enableval"],
[yes|no], [], [yes|no], [],
[AC_MSG_ERROR([bad value $enableval for --enable-xrandr]) ]) ], [AC_MSG_ERROR([bad value $enableval for --enable-randr]) ]) ],
[enable_xrandr=no]) [enable_randr=no])
WM_XEXT_CHECK_XRANDR WM_XEXT_CHECK_XRANDR
dnl dnl

View File

@@ -181,7 +181,7 @@ AC_SUBST(LIBXINERAMA)dnl
# -------------------- # --------------------
# #
# Check for the X RandR (Resize-and-Rotate) extension # Check for the X RandR (Resize-and-Rotate) extension
# The check depends on variable 'enable_xrandr' being either: # The check depends on variable 'enable_randr' being either:
# yes - detect, fail if not found # yes - detect, fail if not found
# no - do not detect, disable support # no - do not detect, disable support
# auto - detect, disable if not found # auto - detect, disable if not found
@@ -190,7 +190,7 @@ AC_SUBST(LIBXINERAMA)dnl
# the variable 'supported_xext' # the variable 'supported_xext'
# When not found, append info to variable 'unsupported' # When not found, append info to variable 'unsupported'
AC_DEFUN_ONCE([WM_XEXT_CHECK_XRANDR], AC_DEFUN_ONCE([WM_XEXT_CHECK_XRANDR],
[WM_LIB_CHECK([XRandR], [-lXrandr], [XRRQueryExtension], [$XLIBS], [WM_LIB_CHECK([RandR], [-lXrandr], [XRRQueryExtension], [$XLIBS],
[wm_save_CFLAGS="$CFLAGS" [wm_save_CFLAGS="$CFLAGS"
AS_IF([wm_fn_lib_try_compile "X11/extensions/Xrandr.h" "Display *dpy;" "XRRQueryExtension(dpy, NULL, NULL)" ""], AS_IF([wm_fn_lib_try_compile "X11/extensions/Xrandr.h" "Display *dpy;" "XRRQueryExtension(dpy, NULL, NULL)" ""],
[], [],

View File

@@ -600,7 +600,7 @@ extern struct wmaker_global_variables {
} xkb; } xkb;
#endif #endif
#ifdef USE_XRANDR #ifdef USE_RANDR
struct { struct {
Bool supported; Bool supported;
int event_base; int event_base;

View File

@@ -1221,7 +1221,7 @@ void wShowInfoPanel(WScreen *scr)
panel->copyrL = WMCreateLabel(panel->win); panel->copyrL = WMCreateLabel(panel->win);
WMResizeWidget(panel->copyrL, 360, 60); WMResizeWidget(panel->copyrL, 360, 60);
WMMoveWidget(panel->copyrL, 15, 185); WMMoveWidget(panel->copyrL, 15, 190);
WMSetLabelTextAlignment(panel->copyrL, WALeft); WMSetLabelTextAlignment(panel->copyrL, WALeft);
WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT); WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT);
font = WMSystemFontOfSize(scr->wmscreen, 11); font = WMSystemFontOfSize(scr->wmscreen, 11);
@@ -1292,14 +1292,6 @@ void wShowInfoPanel(WScreen *scr)
strbuf = wstrappend(strbuf, _("\nAdditional support for: ")); strbuf = wstrappend(strbuf, _("\nAdditional support for: "));
strbuf = wstrappend(strbuf, "WMSPEC"); strbuf = wstrappend(strbuf, "WMSPEC");
#ifdef USE_XRANDR
strbuf = wstrappend(strbuf, ", XRandR ");
if (w_global.xext.randr.supported)
strbuf = wstrappend(strbuf, _("(Supported)"));
else
strbuf = wstrappend(strbuf, _("(Unsupported)"));
#endif
#ifdef MWM_HINTS #ifdef MWM_HINTS
strbuf = wstrappend(strbuf, ", MWM"); strbuf = wstrappend(strbuf, ", MWM");
#endif #endif
@@ -1317,8 +1309,18 @@ void wShowInfoPanel(WScreen *scr)
} }
#endif #endif
#ifdef USE_RANDR
strbuf = wstrappend(strbuf, _("\n"));
strbuf = wstrappend(strbuf, "RandR: ");
if (w_global.xext.randr.supported)
strbuf = wstrappend(strbuf, _("supported"));
else
strbuf = wstrappend(strbuf, _("unsupported"));
strbuf = wstrappend(strbuf, ".");
#endif
panel->infoL = WMCreateLabel(panel->win); panel->infoL = WMCreateLabel(panel->win);
WMResizeWidget(panel->infoL, 350, 75); WMResizeWidget(panel->infoL, 350, 80);
WMMoveWidget(panel->infoL, 15, 115); WMMoveWidget(panel->infoL, 15, 115);
WMSetLabelText(panel->infoL, strbuf); WMSetLabelText(panel->infoL, strbuf);
font = WMSystemFontOfSize(scr->wmscreen, 11); font = WMSystemFontOfSize(scr->wmscreen, 11);

View File

@@ -42,7 +42,7 @@
#include "xdnd.h" #include "xdnd.h"
#endif #endif
#ifdef USE_XRANDR #ifdef USE_RANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#endif #endif
@@ -265,7 +265,7 @@ void DispatchEvent(XEvent * event)
break; break;
case ConfigureNotify: case ConfigureNotify:
#ifdef USE_XRANDR #ifdef USE_RANDR
if (event->xconfigure.window == DefaultRootWindow(dpy)) if (event->xconfigure.window == DefaultRootWindow(dpy))
XRRUpdateConfiguration(event); XRRUpdateConfiguration(event);
#endif #endif
@@ -557,7 +557,7 @@ static void handleExtensions(XEvent * event)
handleXkbIndicatorStateNotify(event); handleXkbIndicatorStateNotify(event);
} }
#endif /*KEEP_XKB_LOCK_STATUS */ #endif /*KEEP_XKB_LOCK_STATUS */
#ifdef USE_XRANDR #ifdef USE_RANDR
if (w_global.xext.randr.supported && event->type == (w_global.xext.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 /* From xrandr man page: "Clients must call back into Xlib using
* XRRUpdateConfiguration when screen configuration change notify * XRRUpdateConfiguration when screen configuration change notify

View File

@@ -31,7 +31,7 @@
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#endif /* KEEP_XKB_LOCK_STATUS */ #endif /* KEEP_XKB_LOCK_STATUS */
#ifdef USE_XRANDR #ifdef USE_RANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#endif #endif
@@ -540,7 +540,7 @@ WScreen *wScreenInit(int screen_number)
} }
#endif /* KEEP_XKB_LOCK_STATUS */ #endif /* KEEP_XKB_LOCK_STATUS */
#ifdef USE_XRANDR #ifdef USE_RANDR
if (w_global.xext.randr.supported) if (w_global.xext.randr.supported)
XRRSelectInput(dpy, scr->root_win, RRScreenChangeNotifyMask); XRRSelectInput(dpy, scr->root_win, RRScreenChangeNotifyMask);
#endif #endif

View File

@@ -44,7 +44,7 @@
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#endif #endif
#ifdef USE_XRANDR #ifdef USE_RANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#endif #endif
@@ -592,7 +592,7 @@ void StartUp(Bool defaultScreenOnly)
w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j); w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j);
#endif #endif
#ifdef USE_XRANDR #ifdef USE_RANDR
w_global.xext.randr.supported = XRRQueryExtension(dpy, &w_global.xext.randr.event_base, &j); w_global.xext.randr.supported = XRRQueryExtension(dpy, &w_global.xext.randr.event_base, &j);
#endif #endif