window: move geometry restore to new output on electric border maximize

Otherwise, unmaximizing the window will move it to a different screen than it's
currently on, which is confusing

BUG: 489488
wilder/Plasma/6.3
Xaver Hugl 2 years ago
parent 34b830f87b
commit dadf3f3a97
  1. 5
      autotests/integration/quick_tiling_test.cpp
  2. 3
      src/window.cpp

@ -340,7 +340,8 @@ void QuickTilingTest::testQuickTilingPointerMove()
Test::pointerMotion(pointerPos, timestamp++);
Test::pointerButtonReleased(BTN_LEFT, timestamp++);
QTEST(window->requestedQuickTileMode(), "expectedMode");
QCOMPARE(window->geometryRestore(), QRect(0, 0, 100, 50));
const QPoint tileOutputPositon = workspace()->outputAt(pointerPos)->geometry().topLeft();
QCOMPARE(window->geometryRestore(), QRect(tileOutputPositon, QSize(100, 50)));
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 2);
QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).toSize(), tileSize);
@ -376,7 +377,7 @@ void QuickTilingTest::testQuickTilingPointerMove()
Test::pointerMotion(pointerPos, timestamp++); // tile the window again
Test::pointerButtonReleased(BTN_LEFT, timestamp++);
QTEST(window->requestedQuickTileMode(), "expectedMode");
QCOMPARE(window->geometryRestore(), QRect(0, 0, 100, 50));
QCOMPARE(window->geometryRestore(), QRect(tileOutputPositon, QSize(100, 50)));
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 4);
QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).toSize(), tileSize);

@ -1251,6 +1251,9 @@ void Window::finishInteractiveMoveResize(bool cancel)
}
} else if (moveResizeOutput() != interactiveMoveResizeStartOutput()) {
sendToOutput(moveResizeOutput()); // checks rule validity
const QRectF oldScreenArea = workspace()->clientArea(MaximizeArea, this, interactiveMoveResizeStartOutput());
const QRectF screenArea = workspace()->clientArea(MaximizeArea, this, moveResizeOutput());
m_electricGeometryRestore = moveToArea(m_electricGeometryRestore, oldScreenArea, screenArea);
if (isRequestedFullScreen() || requestedMaximizeMode() != MaximizeRestore) {
checkWorkspacePosition();
}

Loading…
Cancel
Save