From 0fe48f971d1801eec7b71f31105b69a9ff5c1a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 11 Apr 2012 01:19:15 +0200 Subject: [PATCH] use compositor to elevate current tabbox window BUG: 297809 REVIEW: 104538 --- tabbox/tabbox.cpp | 9 +++++++++ tabbox/tabbox.h | 1 + tabbox/tabboxhandler.cpp | 11 ++++++++++- tabbox/tabboxhandler.h | 5 +++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index d6995598c9..8eedefe885 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -254,6 +254,15 @@ void TabBoxHandlerImpl::restack(TabBoxClient *c, TabBoxClient *under) static_cast(under)->client()); } +void TabBoxHandlerImpl::elevateClient(TabBoxClient *c, bool b) const +{ + if (effects) { + const Client *cl = static_cast(c)->client(); + if (EffectWindow *w = static_cast(effects)->findWindow(cl->window())) + static_cast(effects)->setElevatedWindow(w, b); + } +} + TabBoxClient* TabBoxHandlerImpl::desktopClient() const { diff --git a/tabbox/tabbox.h b/tabbox/tabbox.h index c86a572850..05a129a612 100644 --- a/tabbox/tabbox.h +++ b/tabbox/tabbox.h @@ -54,6 +54,7 @@ public: virtual int nextDesktopFocusChain(int desktop) const; virtual int numberOfDesktops() const; virtual TabBoxClientList stackingOrder() const; + virtual void elevateClient(TabBoxClient* c, bool elevate) const; virtual void raiseClient(TabBoxClient *client) const; virtual void restack(TabBoxClient *c, TabBoxClient *under); virtual TabBoxClient* clientToAddToList(TabBoxClient* client, int desktop) const; diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 2950e51464..98c7b2ad72 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -135,7 +135,13 @@ void TabBoxHandlerPrivate::updateHighlightWindows() Display *dpy = QX11Info::display(); TabBoxClient *currentClient = q->client(index); - if (!KWindowSystem::compositingActive()) { + if (KWindowSystem::compositingActive()) { + if (lastRaisedClient) + q->elevateClient(lastRaisedClient, false); + lastRaisedClient = currentClient; + if (currentClient) + q->elevateClient(currentClient, true); + } else { if (lastRaisedClient) { if (lastRaisedClientSucc) q->restack(lastRaisedClient, lastRaisedClientSucc); @@ -182,6 +188,9 @@ void TabBoxHandlerPrivate::updateHighlightWindows() void TabBoxHandlerPrivate::endHighlightWindows(bool abort) { + TabBoxClient *currentClient = q->client(index); + if (currentClient) + q->elevateClient(currentClient, false); if (abort && lastRaisedClient && lastRaisedClientSucc) q->restack(lastRaisedClient, lastRaisedClientSucc); lastRaisedClient = 0; diff --git a/tabbox/tabboxhandler.h b/tabbox/tabboxhandler.h index 03fee91374..0d5f9faafd 100644 --- a/tabbox/tabboxhandler.h +++ b/tabbox/tabboxhandler.h @@ -136,6 +136,11 @@ public: */ virtual int nextDesktopFocusChain(int desktop) const = 0; + /** + * De-/Elevate a client using the compositor (if enabled) + */ + virtual void elevateClient(TabBoxClient* c, bool elevate) const = 0; + /** * Raise a client (w/o activating it) */