summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2010-05-02 14:57:10 +0200
committerDanny Baumann <dannybaumann@web.de>2010-05-02 14:57:10 +0200
commit5eff4e176ed3c12493311ab2edd60bf9c58a4dc7 (patch)
tree084b7753a3bd085cfbc0c0f907a68b5f77d94146
parentddef9e0a5f0dba12916152b19a250d49b34637ce (diff)
downloadzcomp-5eff4e176ed3c12493311ab2edd60bf9c58a4dc7.tar.gz
zcomp-5eff4e176ed3c12493311ab2edd60bf9c58a4dc7.tar.bz2
Optionally traverse through ancestry when getting the client leader of a
window which has no own client leader set.
-rw-r--r--include/core/window.h2
-rw-r--r--src/window.cpp10
2 files changed, 9 insertions, 3 deletions
diff --git a/include/core/window.h b/include/core/window.h
index ab1cc88..788f1f3 100644
--- a/include/core/window.h
+++ b/include/core/window.h
@@ -378,7 +378,7 @@ class CompWindow :
unsigned int desktop ();
- Window clientLeader ();
+ Window clientLeader (bool checkAncestor = false);
void changeState (unsigned int newState);
diff --git a/src/window.cpp b/src/window.cpp
index 6072f96..3854feb 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -4770,9 +4770,15 @@ CompWindow::desktop ()
}
Window
-CompWindow::clientLeader ()
+CompWindow::clientLeader (bool checkAncestor)
{
- return priv->clientLeader;
+ if (priv->clientLeader)
+ return priv->clientLeader;
+
+ if (checkAncestor)
+ return priv->getClientLeaderOfAncestor ();
+
+ return None;
}
Window