From ea5a5f196d543e6e5336cf93be15fa2233fdd4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 6 Feb 2015 23:00:34 +0100 Subject: [PATCH] allow forcefull restacking when restacking for shaded windows and uncomposited tabboxes the group check should not be applied since we know better eg. to restore a former order CCBUG: 186206 REVIEW: 122469 --- client.cpp | 2 +- layers.cpp | 4 ++-- tabbox/tabbox.cpp | 2 +- workspace.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client.cpp b/client.cpp index 2a08fdf5b3..6d70b11d47 100644 --- a/client.cpp +++ b/client.cpp @@ -884,7 +884,7 @@ void Client::setShade(ShadeMode mode) shade_geometry_change = false; if (was_shade_mode == ShadeHover) { if (shade_below && workspace()->stackingOrder().indexOf(shade_below) > -1) - workspace()->restack(this, shade_below); + workspace()->restack(this, shade_below, true); if (isActive()) workspace()->activateNextClient(this); } else if (isActive()) { diff --git a/layers.cpp b/layers.cpp index e95305e110..91edc04102 100644 --- a/layers.cpp +++ b/layers.cpp @@ -432,10 +432,10 @@ void Workspace::lowerClientRequest(KWin::Client *c, NET::RequestSource src, xcb_ } -void Workspace::restack(Client* c, Client* under) +void Workspace::restack(Client* c, Client* under, bool force) { assert(unconstrained_stacking_order.contains(under)); - if (!Client::belongToSameApplication(under, c)) { + if (!force && !Client::belongToSameApplication(under, c)) { // put in the stacking order below _all_ windows belonging to the active application for (int i = 0; i < unconstrained_stacking_order.size(); ++i) { Client *other = qobject_cast(unconstrained_stacking_order.at(i)); diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index d48139dce4..8662f0a093 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -300,7 +300,7 @@ void TabBoxHandlerImpl::raiseClient(TabBoxClient* c) const void TabBoxHandlerImpl::restack(TabBoxClient *c, TabBoxClient *under) { Workspace::self()->restack(static_cast(c)->client(), - static_cast(under)->client()); + static_cast(under)->client(), true); } void TabBoxHandlerImpl::elevateClient(TabBoxClient *c, WId tabbox, bool b) const diff --git a/workspace.h b/workspace.h index bccc1c1fe3..4ecac3d787 100644 --- a/workspace.h +++ b/workspace.h @@ -176,7 +176,7 @@ public: void raiseClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp); void lowerClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp); void restackClientUnderActive(Client*); - void restack(Client *c, Client *under); + void restack(Client *c, Client *under, bool force = false); void updateClientLayer(Client* c); void raiseOrLowerClient(Client*); void resetUpdateToolWindowsTimer();