summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2012-02-04 15:45:30 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2012-03-22 19:09:50 (GMT)
commit8634d94682800ad0d62b2c6f0c9877b8ba745009 (patch)
treee7afe6639da9f14f247714f0a824e3359590f2ae
parent5aba6f52542fec6abdff7ce84f79e3aa04e4bea6 (diff)
Only keep fullscreen for transients on top - not random group members
BUG: 293265 REVIEW: 103866
-rw-r--r--kwin/layers.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/kwin/layers.cpp b/kwin/layers.cpp
index 13fa1b2..3e91cdb 100644
--- a/kwin/layers.cpp
+++ b/kwin/layers.cpp
@@ -841,15 +841,37 @@ Layer Client::belongsToLayer() const
return NormalLayer;
}
+bool rec_checkTransientOnTop(const ClientList &transients, const Client *topmost)
+{
+ foreach (const Client *transient, transients) {
+ if (transient == topmost || rec_checkTransientOnTop(transient->transients(), topmost)) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool Client::isActiveFullScreen() const
{
+ if (!isFullScreen())
+ return false;
+
+// const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker
+// if (!ac)
+// return false;
+// not needed, for xinerama -> && ( ac == this || this->group() == ac->group())
+
// only raise fullscreen above docks if it's the topmost window in unconstrained stacking order,
// i.e. the window set to be topmost by the user (also includes transients of the fullscreen window)
- const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker
const Client* top = workspace()->topClientOnDesktop(workspace()->currentDesktop(), screen(), true, false);
- return(isFullScreen() && ac != NULL && top != NULL
-// not needed, for xinerama && ( ac == this || this->group() == ac->group())
- && (top == this || this->group() == top->group()));
+ if (!top)
+ return false;
+
+ // check whether we ...
+ if (top == this)
+ return true;
+ // ... or one of our transients is topmost
+ return rec_checkTransientOnTop(transients_list, top);
}
} // namespace