From f24f2bd509ccd8f17c0b9db6d5066cef46ce0d87 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 25 Sep 2020 09:57:28 +0300 Subject: [PATCH] Enable shadow protocol support for all Wayland clients The main motivation for this change is to enable support for our proprietary shadow protocol in LayerShellV1Client. Previously we couldn't move code that handles shadows in WaylandClient because WaylandClient::bufferGeometry() was a pure virtual method. --- inputpanelv1client.cpp | 1 - layershellv1client.cpp | 1 - waylandclient.cpp | 6 +++--- xdgshellclient.cpp | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/inputpanelv1client.cpp b/inputpanelv1client.cpp index e87db17ea..4d56d9486 100644 --- a/inputpanelv1client.cpp +++ b/inputpanelv1client.cpp @@ -32,7 +32,6 @@ InputPanelV1Client::InputPanelV1Client(InputPanelSurfaceV1Interface *panelSurfac setSkipTaskbar(true); setPositionSyncMode(SyncMode::Sync); setSizeSyncMode(SyncMode::Sync); - setupCompositing(); connect(surface(), &SurfaceInterface::aboutToBeDestroyed, this, &InputPanelV1Client::destroyClient); connect(surface(), &SurfaceInterface::sizeChanged, this, &InputPanelV1Client::reposition); diff --git a/layershellv1client.cpp b/layershellv1client.cpp index 49d67a4e1..556e44a06 100644 --- a/layershellv1client.cpp +++ b/layershellv1client.cpp @@ -50,7 +50,6 @@ LayerShellV1Client::LayerShellV1Client(LayerSurfaceV1Interface *shellSurface, setSkipTaskbar(true); setSizeSyncMode(SyncMode::Async); setPositionSyncMode(SyncMode::Sync); - setupCompositing(); connect(shellSurface, &LayerSurfaceV1Interface::aboutToBeDestroyed, this, &LayerShellV1Client::destroyClient); diff --git a/waylandclient.cpp b/waylandclient.cpp index b134e0732..681165f3f 100644 --- a/waylandclient.cpp +++ b/waylandclient.cpp @@ -41,13 +41,13 @@ Q_DECLARE_FLAGS(WaylandGeometryTypes, WaylandGeometryType) WaylandClient::WaylandClient(SurfaceInterface *surface) { - // Note that we cannot setup compositing here because we may need to call visibleRect(), - // which in its turn will call bufferGeometry(), which is a pure virtual method. - setSurface(surface); + setupCompositing(); m_windowId = waylandServer()->createWindowId(surface); + connect(surface, &SurfaceInterface::shadowChanged, + this, &WaylandClient::updateShadow); connect(this, &WaylandClient::frameGeometryChanged, this, &WaylandClient::updateClientOutputs); connect(this, &WaylandClient::desktopFileNameChanged, diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index e47224df6..7980355b9 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -41,7 +41,6 @@ XdgSurfaceClient::XdgSurfaceClient(XdgSurfaceInterface *shellSurface) { setSizeSyncMode(SyncMode::Async); setPositionSyncMode(SyncMode::Async); - setupCompositing(); connect(shellSurface, &XdgSurfaceInterface::configureAcknowledged, this, &XdgSurfaceClient::handleConfigureAcknowledged); @@ -49,8 +48,6 @@ XdgSurfaceClient::XdgSurfaceClient(XdgSurfaceInterface *shellSurface) this, &XdgSurfaceClient::destroyClient); connect(shellSurface->surface(), &SurfaceInterface::committed, this, &XdgSurfaceClient::handleCommit); - connect(shellSurface->surface(), &SurfaceInterface::shadowChanged, - this, &XdgSurfaceClient::updateShadow); #if 0 // TODO: Refactor kwin core in order to uncomment this code. connect(shellSurface->surface(), &SurfaceInterface::mapped, this, &XdgSurfaceClient::setReadyForPainting);