diff --git a/src/screenedge.cpp b/src/screenedge.cpp index da91bf441a717fbbe6628e730ce3cd384657b188..0e29d86c01b5b4901e37cef1f99fb135ceffc62d 100644 --- a/src/screenedge.cpp +++ b/src/screenedge.cpp @@ -1049,8 +1049,7 @@ void ScreenEdges::recreateEdges() ++oldIt) { Edge *oldEdge = *oldIt; if (oldEdge->client()) { - // show the client again and don't recreate the edge - oldEdge->client()->showOnScreenEdge(); + // don't recreate the edge continue; } if (oldEdge->border() != edge->border()) { diff --git a/src/x11client.cpp b/src/x11client.cpp index d5294c376db6c089c6dd5aa192253d515c845fc3..75c3563399f0a68b2bec6b0908121edff3e68642 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -2680,9 +2680,13 @@ void X11Client::readShowOnScreenEdge(Xcb::Property &property) hideClient(); successfullyHidden = isHiddenInternal(); - m_edgeGeometryTrackingConnection = connect(this, &X11Client::frameGeometryChanged, this, [this, border](){ - hideClient(); - ScreenEdges::self()->reserve(this, border); + m_edgeGeometryTrackingConnection = connect(this, &X11Client::frameGeometryChanged, this, [this, border]() { + // frameGeometryChanged will be emitted before and after the panel is moved to the edge, + // but we don't want to call reserve(...) before the panel is moved. (BUG 448420) + QTimer::singleShot(0, this, [this, border] { + hideClient(); + ScreenEdges::self()->reserve(this, border); + }); }); } diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index 433f9a1eb79bb6520b0e6d331075846f6ea567b4..9a5a1df979d527ee0b1b2744c365f11c279c1fb3 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -507,8 +507,11 @@ void XdgSurfaceClient::installPlasmaShellSurface(PlasmaShellSurfaceInterface *sh } updateRole(); updateShowOnScreenEdge(); - connect(this, &XdgSurfaceClient::frameGeometryChanged, - this, &XdgSurfaceClient::updateShowOnScreenEdge); + connect(this, &XdgSurfaceClient::frameGeometryChanged, this, [this] { + // HACK: On Wayland, frameGeometryChanged is emitted only once after a screen is rotated and + // before the panel is moved to any edge, so set a small delay to get the correct geometry of a screen. + QTimer::singleShot(100, this, &XdgSurfaceClient::updateShowOnScreenEdge); + }); connect(this, &XdgSurfaceClient::windowShown, this, &XdgSurfaceClient::updateShowOnScreenEdge);