From 7be4ab97e4a1e974ec77eb1c507ab3d31ec1d7ca Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 3 Sep 2020 13:10:19 +0300 Subject: [PATCH] Move XdgSurfaceClient::cleanTabBox() to WaylandClient It can be useful for other Wayland clients as well. --- waylandclient.cpp | 14 ++++++++++++++ waylandclient.h | 1 + xdgshellclient.cpp | 14 -------------- xdgshellclient.h | 1 - 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/waylandclient.cpp b/waylandclient.cpp index 80f49b194..da599d2fd 100644 --- a/waylandclient.cpp +++ b/waylandclient.cpp @@ -11,6 +11,10 @@ #include "wayland_server.h" #include "workspace.h" +#ifdef KWIN_BUILD_TABBOX +#include "tabbox.h" +#endif + #include #include #include @@ -305,6 +309,16 @@ void WaylandClient::cleanGrouping() } } +void WaylandClient::cleanTabBox() +{ +#ifdef KWIN_BUILD_TABBOX + TabBox::TabBox *tabBox = TabBox::TabBox::self(); + if (tabBox->isDisplayed() && tabBox->currentClient() == this) { + tabBox->nextPrev(true); + } +#endif +} + bool WaylandClient::isShown(bool shaded_is_shown) const { Q_UNUSED(shaded_is_shown) diff --git a/waylandclient.h b/waylandclient.h index d43ec169e..6c279a655 100644 --- a/waylandclient.h +++ b/waylandclient.h @@ -69,6 +69,7 @@ protected: void setPositionSyncMode(SyncMode syncMode); void setSizeSyncMode(SyncMode syncMode); void cleanGrouping(); + void cleanTabBox(); virtual void requestGeometry(const QRect &rect); virtual void updateGeometry(const QRect &rect); diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index 3547f5b6e..ce7b3dee6 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -16,10 +16,6 @@ #include "wayland_server.h" #include "workspace.h" -#ifdef KWIN_BUILD_TABBOX -#include "tabbox.h" -#endif - #include #include #include @@ -383,16 +379,6 @@ void XdgSurfaceClient::setVirtualKeyboardGeometry(const QRect &geo) setFrameGeometry(newWindowGeometry); } -void XdgSurfaceClient::cleanTabBox() -{ -#ifdef KWIN_BUILD_TABBOX - TabBox::TabBox *tabBox = TabBox::TabBox::self(); - if (tabBox->isDisplayed() && tabBox->currentClient() == this) { - tabBox->nextPrev(true); - } -#endif -} - XdgToplevelClient::XdgToplevelClient(XdgToplevelInterface *shellSurface) : XdgSurfaceClient(shellSurface->xdgSurface()) , m_shellSurface(shellSurface) diff --git a/xdgshellclient.h b/xdgshellclient.h index 35c70fb74..7bb695f76 100644 --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -85,7 +85,6 @@ private: void resetHaveNextWindowGeometry(); QRect adjustMoveResizeGeometry(const QRect &rect) const; void updateGeometryRestoreHack(); - void cleanTabBox(); KWaylandServer::XdgSurfaceInterface *m_shellSurface; QTimer *m_configureTimer;