diff --git a/abstract_client.cpp b/abstract_client.cpp index a222ad24eb..a15989a5e7 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -682,6 +682,7 @@ void AbstractClient::setupWindowManagementInterface() w->setMovable(isMovable()); w->setVirtualDesktopChangeable(true); // FIXME Matches Client::actionSupported(), but both should be implemented. w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr); + w->setGeometry(geom); connect(this, &AbstractClient::skipTaskbarChanged, w, [w, this] { w->setSkipTaskbar(skipTaskbar()); @@ -727,6 +728,11 @@ void AbstractClient::setupWindowManagementInterface() w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr); } ); + connect(this, &AbstractClient::geometryChanged, w, + [w, this] { + w->setGeometry(geom); + } + ); connect(w, &PlasmaWindowInterface::closeRequested, this, [this] { closeWindow(); }); connect(w, &PlasmaWindowInterface::moveRequested, this, [this] { diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index c98a18bb7d..45345afb00 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -159,6 +159,10 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() QVERIFY(plasmaWindowCreatedSpy.wait()); QCOMPARE(plasmaWindowCreatedSpy.count(), 1); QCOMPARE(m_windowManagement->windows().count(), 1); + auto pw = m_windowManagement->windows().first(); + QCOMPARE(pw->geometry(), client->geometry()); + QSignalSpy geometryChangedSpy(pw, &PlasmaWindow::geometryChanged); + QVERIFY(geometryChangedSpy.isValid()); QSignalSpy unmappedSpy(m_windowManagement->windows().first(), &PlasmaWindow::unmapped); QVERIFY(unmappedSpy.isValid()); @@ -172,10 +176,14 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() workspace()->slotWindowShade(); QVERIFY(client->isShade()); QVERIFY(client->geometry() != geoBeforeShade); + QVERIFY(geometryChangedSpy.wait()); + QCOMPARE(pw->geometry(), client->geometry()); // and unshade again workspace()->slotWindowShade(); QVERIFY(!client->isShade()); QCOMPARE(client->geometry(), geoBeforeShade); + QVERIFY(geometryChangedSpy.wait()); + QCOMPARE(pw->geometry(), geoBeforeShade); // and destroy the window again xcb_unmap_window(c.data(), w);