From 004bdee7a2ec211fc5b25ebede7d44ea3b885553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 8 Feb 2013 20:59:35 +0100 Subject: [PATCH] do not try to raise possible panel proxies but drop screenedges below the supportWindow instead that's why it exists, that's deterministic, that's faster includes adaption to new screenedge and xcb invocation (compared to 4.10) BUG: 314625 FIXED-IN: 4.10.1 REVIEW: 108867 --- effects.cpp | 2 +- layers.cpp | 14 +++++++++++ screenedge.cpp | 64 -------------------------------------------------- screenedge.h | 5 ---- workspace.h | 4 ++++ 5 files changed, 19 insertions(+), 70 deletions(-) diff --git a/effects.cpp b/effects.cpp index 1d5ef69b7a..c48b5744f7 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1187,7 +1187,7 @@ void EffectsHandlerImpl::destroyInputWindow(xcb_window_t w) if (pos.second == w) { xcb_unmap_window(connection(), w); #ifdef KWIN_BUILD_SCREENEDGES - ScreenEdges::self()->raisePanelProxies(); + Workspace::self()->stackScreenEdgesUnderOverrideRedirect(); #endif return; } diff --git a/layers.cpp b/layers.cpp index 47cf3cc116..2e1205ca33 100644 --- a/layers.cpp +++ b/layers.cpp @@ -144,6 +144,20 @@ void Workspace::updateStackingOrder(bool propagate_new_clients) } } +#ifdef KWIN_BUILD_SCREENEDGES +/*! + * Some fullscreen effects have to raise the screenedge on top of an input window, thus all windows + * this function puts them back where they belong for regular use and is some cheap variant of + * the regular propagateClients function in that it completely ignores managed clients and everything + * else and also does not update the NETWM property. + * Called from Effects::destroyInputWindow so far. + */ +void Workspace::stackScreenEdgesUnderOverrideRedirect() +{ + Xcb::restackWindows(QVector() << supportWindow->winId() << ScreenEdges::self()->windows()); +} +#endif + /*! Propagates the managed clients to the world. Called ONLY from updateStackingOrder(). diff --git a/screenedge.cpp b/screenedge.cpp index b7c50855c9..3c9218a004 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -1063,70 +1063,6 @@ void ScreenEdges::performMousePoll() emit mousePollingTimerEvent(Workspace::self()->cursorPos()); } -/* - * NOTICE THIS IS A HACK - * or at least a quite cumbersome way to handle conflictive electric borders - * (like for autohiding panels or whatever) - * the SANE solution is a central electric border daemon and a protocol - * what this function does is to search for windows on the screen edges that are - * * not our own screenedge - * * either very slim - * * or InputOnly - * and raises them on top of everything else, including our own screen borders - * this is typically (and for now ONLY) called when an effect input window is destroyed - * (which raised our electric borders) - */ - -void ScreenEdges::raisePanelProxies() -{ - QVector ownWindows = windows(); - Xcb::Tree tree(rootWindow()); - QVector attributes(tree->children_len); - QVector geometries(tree->children_len); - - Xcb::WindowId *windows = tree.children(); - QRect screen = QRect(0, 0, displayWidth(), displayHeight()); - QVector proxies; - - int count = 0; - for (unsigned int i = 0; i < tree->children_len; ++i) { - if (ownWindows.contains(windows[i])) { - // one of our screen edges - continue; - } - attributes[count] = Xcb::WindowAttributes(windows[i]); - geometries[count] = Xcb::WindowGeometry(windows[i]); - count++; - } - - for (int i=0; imap_state == XCB_MAP_STATE_UNMAPPED) { - continue; - } - Xcb::WindowGeometry geometry(geometries.at(i)); - if (geometry.isNull()) { - continue; - } - const QRect geo(geometry.rect()); - if (geo.width() < 1 || geo.height() < 1) { - continue; - } - if (!(geo.width() > 1 || geo.height() > 1)) { - continue; // random 1x1 dummy windows, all your corners are belong to us >-) - } - if (attr->_class != XCB_WINDOW_CLASS_INPUT_ONLY && (geo.width() > 3 && geo.height() > 3)) { - continue; - } - if (geo.x() != screen.x() && geo.right() != screen.right() && - geo.y() != screen.y() && geo.bottom() != screen.bottom()) { - continue; - } - proxies << attr.window(); - } - Xcb::restackWindowsWithRaise(proxies); -} - QVector< xcb_window_t > ScreenEdges::windows() const { QVector wins; diff --git a/screenedge.h b/screenedge.h index cf18af2102..76add9d3d3 100644 --- a/screenedge.h +++ b/screenedge.h @@ -249,11 +249,6 @@ public: * to do this if an effect input window is active. */ void ensureOnTop(); - /** - * Raise FOREIGN border windows to the real top of the screen. We usually need - * to do this after an effect input window was active. - */ - void raisePanelProxies(); /** * Called when the user entered an electric border with the mouse. * It may switch to another virtual desktop. diff --git a/workspace.h b/workspace.h index d663c9ef3b..d5b6342d35 100644 --- a/workspace.h +++ b/workspace.h @@ -199,6 +199,10 @@ public: Outline* outline(); +#ifdef KWIN_BUILD_SCREENEDGES + void stackScreenEdgesUnderOverrideRedirect(); +#endif + public: QPoint cascadeOffset(const Client *c) const;