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.
This commit is contained in:
David Edmundson 2021-03-08 22:36:08 +00:00 committed by Vlad Zahorodnii
parent ef19948c00
commit 82551e143d
4 changed files with 1 additions and 13 deletions

View file

@ -1498,7 +1498,7 @@ void AbstractClient::setupWindowManagementInterface()
return; return;
} }
using namespace KWaylandServer; using namespace KWaylandServer;
auto w = waylandServer()->windowManagement()->createWindow(waylandServer()->windowManagement(), internalId()); auto w = waylandServer()->windowManagement()->createWindow(this, internalId());
w->setTitle(caption()); w->setTitle(caption());
w->setVirtualDesktop(isOnAllDesktops() ? 0 : desktop() - 1); w->setVirtualDesktop(isOnAllDesktops() ? 0 : desktop() - 1);
w->setActive(isActive()); w->setActive(isActive());
@ -1685,14 +1685,6 @@ void AbstractClient::setupWindowManagementInterface()
m_windowManagementInterface = w; 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 Options::MouseCommand AbstractClient::getMouseCommand(Qt::MouseButton button, bool *handled) const
{ {
*handled = false; *handled = false;

View file

@ -999,7 +999,6 @@ protected:
virtual void doSetQuickTileMode(); virtual void doSetQuickTileMode();
void setupWindowManagementInterface(); void setupWindowManagementInterface();
void destroyWindowManagementInterface();
void updateColorScheme(); void updateColorScheme();
void setTransientFor(AbstractClient *transientFor); void setTransientFor(AbstractClient *transientFor);
/** /**

View file

@ -206,7 +206,6 @@ void X11Client::releaseWindow(bool on_shutdown)
tabBox->nextPrev(true); tabBox->nextPrev(true);
} }
#endif #endif
destroyWindowManagementInterface();
Deleted* del = nullptr; Deleted* del = nullptr;
if (!on_shutdown) { if (!on_shutdown) {
del = Deleted::create(this); del = Deleted::create(this);
@ -279,7 +278,6 @@ void X11Client::destroyClient()
tabBox->nextPrev(true); tabBox->nextPrev(true);
} }
#endif #endif
destroyWindowManagementInterface();
Deleted* del = Deleted::create(this); Deleted* del = Deleted::create(this);
if (isMoveResize()) if (isMoveResize())
emit clientFinishUserMovedResized(this); emit clientFinishUserMovedResized(this);

View file

@ -328,7 +328,6 @@ void XdgSurfaceClient::destroyClient()
emit windowClosed(this, deleted); emit windowClosed(this, deleted);
StackingUpdatesBlocker blocker(workspace()); StackingUpdatesBlocker blocker(workspace());
RuleBook::self()->discardUsed(this, true); RuleBook::self()->discardUsed(this, true);
destroyWindowManagementInterface();
destroyDecoration(); destroyDecoration();
cleanGrouping(); cleanGrouping();
waylandServer()->removeClient(this); waylandServer()->removeClient(this);