While reviewing how to do things better with RandR I could fix the only issue _I_ had with it.
There is also an attempt to deal with ConfigureNotify events in the root window, which is stolen from the KDE link in the patch. It's on 'next' now. On the long term, Alexey's idea should be the way to go, and this whole Restart() hammer should go away. ---8<--- >From 2242d669c1d5364088f578970f21965b9f86830f Mon Sep 17 00:00:00 2001 From: Carlos R. Mafra <[email protected]> Date: Wed, 22 Sep 2010 16:21:11 +0200 Subject: 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 <[email protected]> --- src/event.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/src/event.c b/src/event.c index 45e4122..55936f0 100644 --- a/src/event.c +++ b/src/event.c @@ -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,11 @@ 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)) { + WCHANGE_STATE(WSTATE_RESTARTING); + Shutdown(WSRestartPreparationMode); Restart(NULL,True); + } #endif } -- 1.7.2.2.119.gf9c33 -- To unsubscribe, send mail to [email protected].
