Remove cleanTabBox duplicated code

This commit is contained in:
Aleix Pol 2021-03-24 18:44:52 +01:00
parent ad7a826ea1
commit 57aec19744
5 changed files with 16 additions and 30 deletions

View file

@ -3756,9 +3756,20 @@ QRect AbstractClient::fullscreenGeometryRestore() const
{
return m_fullscreenGeometryRestore;
}
void AbstractClient::setFullscreenGeometryRestore(const QRect &geom)
{
m_fullscreenGeometryRestore = geom;
}
void AbstractClient::cleanTabBox()
{
#ifdef KWIN_BUILD_TABBOX
TabBox::TabBox *tabBox = TabBox::TabBox::self();
if (tabBox && tabBox->isDisplayed() && tabBox->currentClient() == this) {
tabBox->nextPrev(true);
}
#endif
}
}

View file

@ -1243,6 +1243,9 @@ protected:
QRect m_virtualKeyboardGeometry;
void setFullscreenGeometryRestore(const QRect &geom);
void cleanTabBox();
private Q_SLOTS:
void shadeHover();
void shadeUnhover();

View file

@ -11,10 +11,6 @@
#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>
@ -256,16 +252,6 @@ 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

@ -62,7 +62,6 @@ 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

@ -25,9 +25,6 @@
#include "netinfo.h"
#include "screens.h"
#include "shadow.h"
#ifdef KWIN_BUILD_TABBOX
#include "tabbox.h"
#endif
#include "workspace.h"
#include "screenedge.h"
#include "decorations/decorationbridge.h"
@ -200,12 +197,7 @@ void X11Client::deleteClient(X11Client *c)
void X11Client::releaseWindow(bool on_shutdown)
{
markAsZombie();
#ifdef KWIN_BUILD_TABBOX
TabBox::TabBox *tabBox = TabBox::TabBox::self();
if (tabBox->isDisplayed() && tabBox->currentClient() == this) {
tabBox->nextPrev(true);
}
#endif
cleanTabBox();
Deleted* del = nullptr;
if (!on_shutdown) {
del = Deleted::create(this);
@ -272,12 +264,7 @@ void X11Client::releaseWindow(bool on_shutdown)
void X11Client::destroyClient()
{
markAsZombie();
#ifdef KWIN_BUILD_TABBOX
TabBox::TabBox *tabBox = TabBox::TabBox::self();
if (tabBox && tabBox->isDisplayed() && tabBox->currentClient() == this) {
tabBox->nextPrev(true);
}
#endif
cleanTabBox();
Deleted* del = Deleted::create(this);
if (isMoveResize())
emit clientFinishUserMovedResized(this);