{
error_default = XSetErrorHandler(error_init);
XSelectInput(X.disp, X.root, SubstructureRedirectMask|SubstructureNotifyMask);
- XRRSelectInput(X.disp, X.root, RRScreenChangeNotifyMask);
XSync(X.disp, False);
XSetErrorHandler(error_panic);
XSync(X.disp, False);
}
}
+static void xconfignotify(XEvent* e)
+{
+ XConfigureEvent* ev = &(e->xconfigure);
+ if (ev->window == X.root)
+ {
+ Monitors_Init();
+ }
+}
static void xclientmsg(XEvent* e)
{
Keys_Process(ev);
}
-static void xscreenchangenotify(XEvent* e)
-{
- (void)e;
- Monitors_Init();
-}
-
-
static void init_cursors(void)
{
XColor csr_bdr, csr_fill;
X.eventfns[MotionNotify] = xbtnmotion;
X.eventfns[KeyPress] = xkeypress;
X.eventfns[ConfigureRequest] = xconfigrequest;
+ X.eventfns[ConfigureNotify] = xconfignotify;
X.eventfns[ClientMessage] = xclientmsg;
X.eventfns[PropertyNotify] = xpropnotify;
X.eventfns[EnterNotify] = xenternotify;
X.eventfns[Expose] = xexpose;
- X.eventfns[RRScreenChangeNotify] = xscreenchangenotify;
-
/* main event loop */
XSync(X.disp, False);
cflags="-g -Wall -Wextra -Werror"
incpath="-I/usr/X11R6/include -Itest/"
libpath="-L/usr/X11R6/lib"
-libs="-lX11 -lXinerama -lm -lXrandr"
+libs="-lX11 -lXinerama -lm"
cc $cflags $incpath $libpath -o anvil ./*.c $libs \
# && ./atf $incpath test/*.c