Move XdgSurfaceClient::cleanTabBox() to WaylandClient

It can be useful for other Wayland clients as well.
master
Vlad Zahorodnii 2020-09-03 13:10:19 +03:00
parent e2aaff63f7
commit 7be4ab97e4
4 changed files with 15 additions and 15 deletions

View File

@ -11,6 +11,10 @@
#include "wayland_server.h"
#include "workspace.h"
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
#include <KWaylandServer/display.h>
#include <KWaylandServer/clientconnection.h>
#include <KWaylandServer/surface_interface.h>
@ -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)

View File

@ -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);

View File

@ -16,10 +16,6 @@
#include "wayland_server.h"
#include "workspace.h"
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
#include <KDecoration2/DecoratedClient>
#include <KDecoration2/Decoration>
#include <KWaylandServer/appmenu_interface.h>
@ -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)

View File

@ -85,7 +85,6 @@ private:
void resetHaveNextWindowGeometry();
QRect adjustMoveResizeGeometry(const QRect &rect) const;
void updateGeometryRestoreHack();
void cleanTabBox();
KWaylandServer::XdgSurfaceInterface *m_shellSurface;
QTimer *m_configureTimer;