Make wmaker XRandR aware
[wmaker-crm.git] / src / screen.c
index 1a119c2..a9e52e6 100644 (file)
 #ifdef KEEP_XKB_LOCK_STATUS
 #include <X11/XKBlib.h>
 #endif                         /* KEEP_XKB_LOCK_STATUS */
+#ifdef HAVE_XRANDR
+#include <X11/extensions/Xrandr.h>
+#endif
 
 #include <wraster.h>
-
 #include "WindowMaker.h"
 #include "def_pixmaps.h"
 #include "screen.h"
@@ -77,6 +79,9 @@ extern int wScreenCount;
 #ifdef KEEP_XKB_LOCK_STATUS
 extern int wXkbSupported;
 #endif
+#ifdef HAVE_XRANDR
+extern int has_randr;
+#endif
 
 extern WDDomain *WDWindowMaker;
 
@@ -598,6 +603,11 @@ WScreen *wScreenInit(int screen_number)
        }
 #endif                         /* KEEP_XKB_LOCK_STATUS */
 
+#ifdef HAVE_XRANDR
+       if (has_randr)
+               XRRSelectInput(dpy, scr->root_win, RRScreenChangeNotifyMask);
+#endif
+
        XSync(dpy, False);
        XSetErrorHandler(oldHandler);