wayland: Setup window management integration on initial commit

Originally, there was ShellClient class that was the predecessor to
WaylandClient subclasses. If the main surface is unmapped, the
corresponding instance of ShellClient would be kept around. That had
been changed with the introduction of XdgToplevelClient and
XdgPopupClient.

Since ShellClient had been kept alive even if the corresponding surface
were unmapped, it did make sense to setup window management integration
when the surface is mapped.

However, this also means that plasma will not know about initially
minimized windows.

Since unmapped windows are handled differently now, we can setup window
management after the client performs the initial commit. If the main
surface is unmapped, the XdgToplevelClient object will be destroyed and
with it, the window management integration.
This commit is contained in:
Vlad Zahorodnii 2021-08-29 12:26:06 +03:00 committed by David Edmundson
parent 63b16cdf9d
commit 8b85fdcedf
2 changed files with 5 additions and 11 deletions

View file

@ -356,7 +356,6 @@ XdgToplevelClient::XdgToplevelClient(XdgToplevelInterface *shellSurface)
: XdgSurfaceClient(shellSurface->xdgSurface())
, m_shellSurface(shellSurface)
{
setupWindowManagementIntegration();
setupPlasmaShellIntegration();
setDesktops({VirtualDesktopManager::self()->currentDesktop()});
#if KWIN_BUILD_ACTIVITIES
@ -1237,6 +1236,11 @@ void XdgToplevelClient::initialize()
scheduleConfigure();
updateColorScheme();
if (!isLockScreen()) {
setupWindowManagementInterface();
}
m_isInitialized = true;
}
@ -1514,15 +1518,6 @@ void XdgToplevelClient::updateClientArea()
}
}
void XdgToplevelClient::setupWindowManagementIntegration()
{
if (isLockScreen()) {
return;
}
connect(surface(), &SurfaceInterface::mapped,
this, &XdgToplevelClient::setupWindowManagementInterface);
}
void XdgToplevelClient::setupPlasmaShellIntegration()
{
connect(surface(), &SurfaceInterface::mapped,

View file

@ -192,7 +192,6 @@ private:
void updateFullScreenMode(bool set);
void updateShowOnScreenEdge();
void updateClientArea();
void setupWindowManagementIntegration();
void setupPlasmaShellIntegration();
void sendPing(PingReason reason);
MaximizeMode initialMaximizeMode() const;