mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
XRandR temporary amendments
If we Restart() directly, the windows with titlebars come back N pixels below their original positions before the xrandr-induced restart, where N is the titlebar height. To avoid this issue, let's do the proper restart preparation before actually calling Restart(). Let's also grab ConfigureNotify in the event loop as in the patch here: http://lists.kde.org/?l=kwin&m=116429907520188&w=2 (thanks to Tamas for pointing it out). Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
18
src/event.c
18
src/event.c
@@ -292,6 +292,15 @@ void DispatchEvent(XEvent * event)
|
|||||||
case VisibilityNotify:
|
case VisibilityNotify:
|
||||||
handleVisibilityNotify(event);
|
handleVisibilityNotify(event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ConfigureNotify:
|
||||||
|
if (event->xconfigure.window == DefaultRootWindow(dpy)) {
|
||||||
|
#ifdef HAVE_XRANDR
|
||||||
|
XRRUpdateConfiguration(event);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
handleExtensions(event);
|
handleExtensions(event);
|
||||||
break;
|
break;
|
||||||
@@ -572,8 +581,15 @@ static void handleExtensions(XEvent * event)
|
|||||||
}
|
}
|
||||||
#endif /*KEEP_XKB_LOCK_STATUS */
|
#endif /*KEEP_XKB_LOCK_STATUS */
|
||||||
#ifdef HAVE_XRANDR
|
#ifdef HAVE_XRANDR
|
||||||
if (has_randr && event->type == (randr_event_base + RRScreenChangeNotify))
|
if (has_randr && event->type == (randr_event_base + RRScreenChangeNotify)) {
|
||||||
|
/* From xrandr man page: "Clients must call back into Xlib using
|
||||||
|
* XRRUpdateConfiguration when screen configuration change notify
|
||||||
|
* events are generated */
|
||||||
|
XRRUpdateConfiguration(event);
|
||||||
|
WCHANGE_STATE(WSTATE_RESTARTING);
|
||||||
|
Shutdown(WSRestartPreparationMode);
|
||||||
Restart(NULL,True);
|
Restart(NULL,True);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user