From 49e5e81970ea780b116c37c0a98428a9e58f8e59 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 16 Sep 2015 16:36:26 +0200 Subject: [PATCH] support raise and lower windows on wayland connect raise/lowerRequested to workspace()->raiseClientRequest /workspace()->lowerClientRequest REVIEWED-BY:Martin Graesslin --- layers.cpp | 6 +++++- shell_client.cpp | 7 +++++++ workspace.h | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/layers.cpp b/layers.cpp index 7b8517b592..6113ebab49 100644 --- a/layers.cpp +++ b/layers.cpp @@ -413,7 +413,7 @@ void Workspace::raiseClientWithinApplication(AbstractClient* c) } } -void Workspace::raiseClientRequest(KWin::Client *c, NET::RequestSource src, xcb_timestamp_t timestamp) +void Workspace::raiseClientRequest(KWin::AbstractClient *c, NET::RequestSource src, xcb_timestamp_t timestamp) { if (src == NET::FromTool || allowFullClientRaising(c, timestamp)) raiseClient(c); @@ -435,6 +435,10 @@ void Workspace::lowerClientRequest(KWin::Client *c, NET::RequestSource src, xcb_ lowerClientWithinApplication(c); } +void Workspace::lowerClientRequest(KWin::AbstractClient *c) +{ + lowerClientWithinApplication(c); +} void Workspace::restack(AbstractClient* c, AbstractClient* under, bool force) { diff --git a/shell_client.cpp b/shell_client.cpp index ac8d48a5a8..f4d9260002 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -689,6 +689,13 @@ bool ShellClient::isInitialPositionSet() const void ShellClient::installQtExtendedSurface(QtExtendedSurfaceInterface *surface) { m_qtExtendedSurface = surface; + + connect(m_qtExtendedSurface, &QtExtendedSurfaceInterface::raiseRequested, this, [this]() { + workspace()->raiseClientRequest(this); + }); + connect(m_qtExtendedSurface, &QtExtendedSurfaceInterface::lowerRequested, this, [this]() { + workspace()->lowerClientRequest(this); + }); } bool ShellClient::hasStrut() const diff --git a/workspace.h b/workspace.h index b5df7a4cfe..b9c9390eda 100644 --- a/workspace.h +++ b/workspace.h @@ -176,8 +176,9 @@ public: QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode); void raiseClient(AbstractClient* c, bool nogroup = false); void lowerClient(AbstractClient* c, bool nogroup = false); - void raiseClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp); + void raiseClientRequest(AbstractClient* c, NET::RequestSource src = NET::FromApplication, xcb_timestamp_t timestamp = 0); void lowerClientRequest(Client* c, NET::RequestSource src, xcb_timestamp_t timestamp); + void lowerClientRequest(AbstractClient* c); void restackClientUnderActive(AbstractClient*); void restack(AbstractClient *c, AbstractClient *under, bool force = false); void updateClientLayer(AbstractClient* c);