diff --git a/activation.cpp b/activation.cpp index 5779f76781..451394f403 100644 --- a/activation.cpp +++ b/activation.cpp @@ -667,8 +667,10 @@ void Client::updateUserTime(Time time) time = xTime(); if (time != -1U && (user_time == CurrentTime - || timestampCompare(time, user_time) > 0)) // time > user_time + || timestampCompare(time, user_time) > 0)) { // time > user_time user_time = time; + shade_below = NULL; // do not hover re-shade a window after it got interaction + } group()->updateUserTime(user_time); } diff --git a/client.cpp b/client.cpp index 26611dc022..d9e1ad7f0c 100644 --- a/client.cpp +++ b/client.cpp @@ -95,6 +95,7 @@ Client::Client(Workspace* ws) , transient_for (NULL) , transient_for_id(None) , original_transient_for_id(None) + , shade_below(NULL) , skip_switcher(false) , blocks_compositing(false) , autoRaiseTimer(NULL) @@ -1099,8 +1100,11 @@ void Client::setShade(ShadeMode mode) plainResize(s); shade_geometry_change = false; if (isActive()) { - if (was_shade_mode == ShadeHover) + if (was_shade_mode == ShadeHover) { + if (shade_below && workspace()->stackingOrder().indexOf(shade_below) > -1) + workspace()->restack(this, shade_below); workspace()->activateNextClient(this); + } else workspace()->focusToNull(); } @@ -1111,6 +1115,15 @@ void Client::setShade(ShadeMode mode) plainResize(s); if (shade_mode == ShadeHover || shade_mode == ShadeActivated) setActive(true); + if (shade_mode == ShadeHover) { + ClientList order = workspace()->stackingOrder(); + int idx = order.indexOf(this) + 1; // this is likely related to the index parameter?! + shade_below = (idx < order.count()) ? order.at(idx) : NULL; + if (shade_below && shade_below->isNormalWindow()) + workspace()->raiseClient(this); + else + shade_below = NULL; + } XMapWindow(display(), wrapperId()); XMapWindow(display(), window()); if (isActive()) diff --git a/client.h b/client.h index c35643f250..cef1e85cad 100644 --- a/client.h +++ b/client.h @@ -823,6 +823,7 @@ private: Window original_transient_for_id; ClientList transients_list; // SELI TODO: Make this ordered in stacking order? ShadeMode shade_mode; + Client *shade_below; uint active : 1; uint deleting : 1; ///< True when doing cleanup and destroying the client uint keep_above : 1; ///< NET::KeepAbove (was stays_on_top)