1
0
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:
Carlos R. Mafra
2010-09-22 16:21:11 +02:00
parent e7f3e62d69
commit 80814b7dba

View File

@@ -292,6 +292,15 @@ void DispatchEvent(XEvent * event)
case VisibilityNotify:
handleVisibilityNotify(event);
break;
case ConfigureNotify:
if (event->xconfigure.window == DefaultRootWindow(dpy)) {
#ifdef HAVE_XRANDR
XRRUpdateConfiguration(event);
#endif
}
break;
default:
handleExtensions(event);
break;
@@ -572,8 +581,15 @@ static void handleExtensions(XEvent * event)
}
#endif /*KEEP_XKB_LOCK_STATUS */
#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);
}
#endif
}