From 82551e143db67db5c786a0eb0d403d9d16dd0d56 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 8 Mar 2021 22:36:08 +0000 Subject: [PATCH] Adapt to window management changes Our wayland interface lifespan only needs to live as long as the window is mapped. Given this corresponds directly to the lifespan of AbstractClient we can just set a parent and everything is handled implicitly. --- src/abstract_client.cpp | 10 +--------- src/abstract_client.h | 1 - src/x11client.cpp | 2 -- src/xdgshellclient.cpp | 1 - 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index defcfe9539..3e3d36539c 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -1498,7 +1498,7 @@ void AbstractClient::setupWindowManagementInterface() return; } using namespace KWaylandServer; - auto w = waylandServer()->windowManagement()->createWindow(waylandServer()->windowManagement(), internalId()); + auto w = waylandServer()->windowManagement()->createWindow(this, internalId()); w->setTitle(caption()); w->setVirtualDesktop(isOnAllDesktops() ? 0 : desktop() - 1); w->setActive(isActive()); @@ -1685,14 +1685,6 @@ void AbstractClient::setupWindowManagementInterface() m_windowManagementInterface = w; } -void AbstractClient::destroyWindowManagementInterface() -{ - if (m_windowManagementInterface) { - m_windowManagementInterface->unmap(); - m_windowManagementInterface = nullptr; - } -} - Options::MouseCommand AbstractClient::getMouseCommand(Qt::MouseButton button, bool *handled) const { *handled = false; diff --git a/src/abstract_client.h b/src/abstract_client.h index 7577cfceb0..4fad9eeaa5 100644 --- a/src/abstract_client.h +++ b/src/abstract_client.h @@ -999,7 +999,6 @@ protected: virtual void doSetQuickTileMode(); void setupWindowManagementInterface(); - void destroyWindowManagementInterface(); void updateColorScheme(); void setTransientFor(AbstractClient *transientFor); /** diff --git a/src/x11client.cpp b/src/x11client.cpp index 6caa15015d..cc46887259 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -206,7 +206,6 @@ void X11Client::releaseWindow(bool on_shutdown) tabBox->nextPrev(true); } #endif - destroyWindowManagementInterface(); Deleted* del = nullptr; if (!on_shutdown) { del = Deleted::create(this); @@ -279,7 +278,6 @@ void X11Client::destroyClient() tabBox->nextPrev(true); } #endif - destroyWindowManagementInterface(); Deleted* del = Deleted::create(this); if (isMoveResize()) emit clientFinishUserMovedResized(this); diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index 773e93122c..2e7069be19 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -328,7 +328,6 @@ void XdgSurfaceClient::destroyClient() emit windowClosed(this, deleted); StackingUpdatesBlocker blocker(workspace()); RuleBook::self()->discardUsed(this, true); - destroyWindowManagementInterface(); destroyDecoration(); cleanGrouping(); waylandServer()->removeClient(this);