diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -222,7 +222,7 @@ * The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal * might be emitted at each resize step or only at the end of the resize operation. */ - Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry) + Q_PROPERTY(QRect geometry READ frameGeometry WRITE setFrameGeometry) /** * Whether the Client is currently being moved by the user. @@ -630,8 +630,8 @@ void keepInArea(QRect area, bool partial = false); virtual QSize minSize() const; virtual QSize maxSize() const; - virtual void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0; - void setGeometry(const QRect& r, ForceGeometry_t force = NormalGeometrySet); + virtual void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0; + void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet); /// How to resize the window in order to obey constains (mainly aspect ratios) enum Sizemode { SizemodeAny, @@ -1293,9 +1293,9 @@ resizeWithChecks(s.width(), s.height(), force); } -inline void AbstractClient::setGeometry(const QRect& r, ForceGeometry_t force) +inline void AbstractClient::setFrameGeometry(const QRect &rect, ForceGeometry_t force) { - setGeometry(r.x(), r.y(), r.width(), r.height(), force); + setFrameGeometry(rect.x(), rect.y(), rect.width(), rect.height(), force); } inline const QList& AbstractClient::transients() const diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -87,11 +87,11 @@ connect(this, &AbstractClient::geometryShapeChanged, this, [this] (Toplevel *c, const QRect &old) { Q_UNUSED(c) - if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size() && !isInitialPositionSet()) { + if (isOnScreenDisplay() && !frameGeometry().isEmpty() && old.size() != frameGeometry().size() && !isInitialPositionSet()) { GeometryUpdatesBlocker blocker(this); const QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); Placement::self()->place(this, area); - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); } } ); @@ -728,11 +728,11 @@ resizeWithChecks(qMin(area.width(), width()), qMin(area.height(), height())); } int tx = x(), ty = y(); - if (geometry().right() > area.right() && width() <= area.width()) + if (frameGeometry().right() > area.right() && width() <= area.width()) tx = area.right() - width() + 1; - if (geometry().bottom() > area.bottom() && height() <= area.height()) + if (frameGeometry().bottom() > area.bottom() && height() <= area.height()) ty = area.bottom() - height() + 1; - if (!area.contains(geometry().topLeft())) { + if (!area.contains(frameGeometry().topLeft())) { if (tx < area.x()) tx = area.x(); if (ty < area.y()) @@ -804,7 +804,7 @@ w->setMovable(isMovable()); w->setVirtualDesktopChangeable(true); // FIXME Matches X11Client::actionSupported(), but both should be implemented. w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr); - w->setGeometry(geometry()); + w->setGeometry(frameGeometry()); connect(this, &AbstractClient::skipTaskbarChanged, w, [w, this] { w->setSkipTaskbar(skipTaskbar()); @@ -844,19 +844,19 @@ ); connect(this, &AbstractClient::geometryChanged, w, [w, this] { - w->setGeometry(geometry()); + w->setGeometry(frameGeometry()); } ); connect(w, &PlasmaWindowInterface::closeRequested, this, [this] { closeWindow(); }); connect(w, &PlasmaWindowInterface::moveRequested, this, [this] { - Cursor::setPos(geometry().center()); + Cursor::setPos(frameGeometry().center()); performMouseCommand(Options::MouseMove, Cursor::pos()); } ); connect(w, &PlasmaWindowInterface::resizeRequested, this, [this] { - Cursor::setPos(geometry().bottomRight()); + Cursor::setPos(frameGeometry().bottomRight()); performMouseCommand(Options::MouseResize, Cursor::pos()); } ); @@ -1041,7 +1041,7 @@ AbstractClient *c = qobject_cast(*it); if (!c || (c->keepAbove() && !keepAbove()) || (keepBelow() && !c->keepBelow())) continue; // can never raise above "it" - mustReplay = !(c->isOnCurrentDesktop() && c->isOnCurrentActivity() && c->geometry().intersects(geometry())); + mustReplay = !(c->isOnCurrentDesktop() && c->isOnCurrentActivity() && c->frameGeometry().intersects(frameGeometry())); } } workspace()->takeActivity(this, Workspace::ActivityFocus | Workspace::ActivityRaise); @@ -1308,16 +1308,16 @@ void AbstractClient::updateGeometryBeforeUpdateBlocking() { - m_geometryBeforeUpdateBlocking = geometry(); + m_geometryBeforeUpdateBlocking = frameGeometry(); } void AbstractClient::doMove(int, int) { } void AbstractClient::updateInitialMoveResizeGeometry() { - m_moveResize.initialGeometry = geometry(); + m_moveResize.initialGeometry = frameGeometry(); m_moveResize.geometry = m_moveResize.initialGeometry; m_moveResize.startScreen = screen(); } @@ -1796,13 +1796,13 @@ { // No keyboard anymore if (geo.isEmpty() && !m_keyboardGeometryRestore.isEmpty()) { - setGeometry(m_keyboardGeometryRestore); + setFrameGeometry(m_keyboardGeometryRestore); m_keyboardGeometryRestore = QRect(); } else if (geo.isEmpty()) { return; // The keyboard has just been opened (rather than resized) save client geometry for a restore } else if (m_keyboardGeometryRestore.isEmpty()) { - m_keyboardGeometryRestore = geometry(); + m_keyboardGeometryRestore = frameGeometry(); } m_virtualKeyboardGeometry = geo; @@ -1821,7 +1821,7 @@ newWindowGeometry.moveBottom(geo.top()); newWindowGeometry.setTop(qMax(newWindowGeometry.top(), availableArea.top())); - setGeometry(newWindowGeometry); + setFrameGeometry(newWindowGeometry); } bool AbstractClient::dockWantsInput() const diff --git a/activation.cpp b/activation.cpp --- a/activation.cpp +++ b/activation.cpp @@ -430,7 +430,7 @@ client->isOnCurrentActivity() && client->isOnScreen(screen))) continue; - if (client->geometry().contains(Cursor::pos())) { + if (client->frameGeometry().contains(Cursor::pos())) { return client; } } diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -201,7 +201,7 @@ QVERIFY(!c->keepBelow()); quint32 timestamp = 1; - MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); + MOTION(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); QVERIFY(!input()->pointer()->decoration().isNull()); QCOMPARE(input()->pointer()->decoration()->decoration()->sectionUnderMouse(), Qt::TitleBarArea); @@ -252,7 +252,7 @@ QVERIFY(!c->noBorder()); QVERIFY(!c->isOnAllDesktops()); quint32 timestamp = 1; - MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); + MOTION(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); // double click PRESS; @@ -307,7 +307,7 @@ QVERIFY(!c->noBorder()); QVERIFY(!c->isOnAllDesktops()); quint32 timestamp = 1; - const QPoint tapPoint(c->geometry().center().x(), c->clientPos().y() / 2); + const QPoint tapPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2); // double tap kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); @@ -361,7 +361,7 @@ c->move(QPoint(20, 0)); quint32 timestamp = 1; - MOTION(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); + MOTION(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); // There is a mismatch of the cursor key positions between windows @@ -375,24 +375,24 @@ return hasBorders ? -1 : 0; }; - MOTION(QPoint(c->geometry().x(), 0)); + MOTION(QPoint(c->frameGeometry().x(), 0)); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthWest)); - MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, 0)); + MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() / 2, 0)); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorth)); - MOTION(QPoint(c->geometry().x() + c->geometry().width() - 1, 0)); + MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() - 1, 0)); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthEast)); - MOTION(QPoint(c->geometry().x() + c->geometry().width() + deviation(), c->height() / 2)); + MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() + deviation(), c->height() / 2)); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeEast)); - MOTION(QPoint(c->geometry().x() + c->geometry().width() + deviation(), c->height() - 1)); + MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() + deviation(), c->height() - 1)); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthEast)); - MOTION(QPoint(c->geometry().x() + c->geometry().width() / 2, c->height() + deviation())); + MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() / 2, c->height() + deviation())); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouth)); - MOTION(QPoint(c->geometry().x(), c->height() + deviation())); + MOTION(QPoint(c->frameGeometry().x(), c->height() + deviation())); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthWest)); - MOTION(QPoint(c->geometry().x() - 1, c->height() / 2)); + MOTION(QPoint(c->frameGeometry().x() - 1, c->height() / 2)); QCOMPARE(c->cursor(), CursorShape(KWin::ExtendedCursor::SizeWest)); - MOTION(c->geometry().center()); + MOTION(c->frameGeometry().center()); QEXPECT_FAIL("", "Cursor not set back on leave", Continue); QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); } @@ -428,13 +428,13 @@ QVERIFY(clientFinishUserMovedResizedSpy.isValid()); quint32 timestamp = 1; - MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); + MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2)); QCOMPARE(c->cursor(), CursorShape(Qt::ArrowCursor)); PRESS; QVERIFY(!c->isMove()); QFETCH(QPoint, offset); - MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset); + MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset); const QPoint oldPos = c->pos(); QVERIFY(c->isMove()); QCOMPARE(startMoveResizedSpy.count(), 1); @@ -449,11 +449,11 @@ PRESS; QVERIFY(!c->isMove()); QFETCH(QPoint, offset2); - MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2); + MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2); QVERIFY(c->isMove()); QCOMPARE(startMoveResizedSpy.count(), 2); QFETCH(QPoint, offset3); - MOTION(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3); + MOTION(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3); RELEASE; QTRY_VERIFY(!c->isMove()); @@ -493,7 +493,7 @@ QVERIFY(clientFinishUserMovedResizedSpy.isValid()); quint32 timestamp = 1; - QPoint p = QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2); + QPoint p = QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2); kwinApp()->platform()->touchDown(0, p, timestamp++); QVERIFY(!c->isMove()); @@ -515,11 +515,11 @@ QCOMPARE(input()->touch()->decorationPressId(), 1); QVERIFY(!c->isMove()); QFETCH(QPoint, offset2); - kwinApp()->platform()->touchMotion(1, QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2, timestamp++); + kwinApp()->platform()->touchMotion(1, QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset2, timestamp++); QVERIFY(c->isMove()); QCOMPARE(startMoveResizedSpy.count(), 2); QFETCH(QPoint, offset3); - kwinApp()->platform()->touchMotion(1, QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3, timestamp++); + kwinApp()->platform()->touchMotion(1, QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2) + offset3, timestamp++); kwinApp()->platform()->touchUp(1, timestamp++); QTRY_VERIFY(!c->isMove()); @@ -558,28 +558,28 @@ QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); - QVERIFY(c->geometry() != c->inputGeometry()); - QVERIFY(c->inputGeometry().contains(c->geometry())); + QVERIFY(c->frameGeometry() != c->inputGeometry()); + QVERIFY(c->inputGeometry().contains(c->frameGeometry())); QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); QVERIFY(startMoveResizedSpy.isValid()); // go to border quint32 timestamp = 1; QFETCH(Qt::Edge, edge); switch (edge) { case Qt::LeftEdge: - MOTION(QPoint(c->geometry().x() -1, c->geometry().center().y())); + MOTION(QPoint(c->frameGeometry().x() -1, c->frameGeometry().center().y())); break; case Qt::RightEdge: - MOTION(QPoint(c->geometry().x() + c->geometry().width() +1, c->geometry().center().y())); + MOTION(QPoint(c->frameGeometry().x() + c->frameGeometry().width() +1, c->frameGeometry().center().y())); break; case Qt::BottomEdge: - MOTION(QPoint(c->geometry().center().x(), c->geometry().y() + c->geometry().height() + 1)); + MOTION(QPoint(c->frameGeometry().center().x(), c->frameGeometry().y() + c->frameGeometry().height() + 1)); break; default: break; } - QVERIFY(!c->geometry().contains(KWin::Cursor::pos())); + QVERIFY(!c->frameGeometry().contains(KWin::Cursor::pos())); // pressing should trigger resize PRESS; @@ -665,7 +665,7 @@ QVERIFY(!c->noBorder()); c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); // move cursor on window - Cursor::setPos(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); + Cursor::setPos(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2)); // simulate modifier+click quint32 timestamp = 1; @@ -736,7 +736,7 @@ QVERIFY(!c->noBorder()); c->move(screens()->geometry(0).center() - QPoint(c->width()/2, c->height()/2)); // move cursor on window - Cursor::setPos(QPoint(c->geometry().center().x(), c->y() + c->clientPos().y() / 2)); + Cursor::setPos(QPoint(c->frameGeometry().center().x(), c->y() + c->clientPos().y() / 2)); // set the opacity to 0.5 c->setOpacity(0.5); QCOMPARE(c->opacity(), 0.5); @@ -808,7 +808,7 @@ QVERIFY(hoverLeaveSpy.isValid()); quint32 timestamp = 1; - const QPoint tapPoint(c->geometry().center().x(), c->clientPos().y() / 2); + const QPoint tapPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2); QVERIFY(!input()->touch()->decoration()); kwinApp()->platform()->touchDown(0, tapPoint, timestamp++); diff --git a/autotests/integration/desktop_window_x11_test.cpp b/autotests/integration/desktop_window_x11_test.cpp --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -156,7 +156,7 @@ QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); QCOMPARE(client->windowType(), NET::Desktop); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); QVERIFY(client->isDesktop()); QCOMPARE(client->depth(), 24); QVERIFY(!client->hasAlpha()); diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -135,7 +135,7 @@ QSignalSpy maximizedStateChangedSpy(client, static_cast(&AbstractClient::clientMaximizedStateChanged)); QVERIFY(maximizedStateChangedSpy.isValid()); quint32 timestamp = 1; - kwinApp()->platform()->pointerMotion(client->geometry().topLeft() + scenePoint.toPoint(), timestamp++); + kwinApp()->platform()->pointerMotion(client->frameGeometry().topLeft() + scenePoint.toPoint(), timestamp++); kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); QVERIFY(maximizedStateChangedSpy.wait()); diff --git a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp @@ -115,7 +115,7 @@ // and fake a cursor theme change, so that the theme gets recreated emit KWin::Cursor::self()->themeChanged(); - KWin::Cursor::setPos(QPoint(c->geometry().center().x(), c->clientPos().y() / 2)); + KWin::Cursor::setPos(QPoint(c->frameGeometry().center().x(), c->clientPos().y() / 2)); } WAYLANDTEST_MAIN(DontCrashCursorPhysicalSizeEmpty) diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -104,8 +104,8 @@ QVERIFY(client->isDecorated()); // let's set a stupid geometry - client->setGeometry(0, 0, 0, 0); - QCOMPARE(client->geometry(), QRect(0, 0, 0, 0)); + client->setFrameGeometry(0, 0, 0, 0); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 0, 0)); // and destroy the window again xcb_unmap_window(c, w); diff --git a/autotests/integration/effects/minimize_animation_test.cpp b/autotests/integration/effects/minimize_animation_test.cpp --- a/autotests/integration/effects/minimize_animation_test.cpp +++ b/autotests/integration/effects/minimize_animation_test.cpp @@ -137,7 +137,7 @@ XdgShellClient *panel = Test::renderAndWaitForShown(panelSurface.data(), panelRect.size(), Qt::blue); QVERIFY(panel); QVERIFY(panel->isDock()); - QCOMPARE(panel->geometry(), panelRect); + QCOMPARE(panel->frameGeometry(), panelRect); QVERIFY(plasmaWindowCreatedSpy.wait()); QCOMPARE(plasmaWindowCreatedSpy.count(), 1); @@ -158,7 +158,7 @@ const QRect iconRect = QRect(0, 0, 42, 36); window->setMinimizedGeometry(panelSurface.data(), iconRect); Test::flushWaylandConnection(); - QTRY_COMPARE(client->iconGeometry(), iconRect.translated(panel->geometry().topLeft())); + QTRY_COMPARE(client->iconGeometry(), iconRect.translated(panel->frameGeometry().topLeft())); // Load effect that will be tested. QFETCH(QString, effectName); diff --git a/autotests/integration/effects/translucency_test.cpp b/autotests/integration/effects/translucency_test.cpp --- a/autotests/integration/effects/translucency_test.cpp +++ b/autotests/integration/effects/translucency_test.cpp @@ -164,7 +164,7 @@ workspace()->sendClientToDesktop(client, 2, false); effects->setCurrentDesktop(2); QVERIFY(!m_translucencyEffect->isActive()); - KWin::Cursor::setPos(client->geometry().center()); + KWin::Cursor::setPos(client->frameGeometry().center()); workspace()->performWindowOperation(client, Options::MoveOp); QVERIFY(m_translucencyEffect->isActive()); QTest::qWait(200); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -150,7 +150,7 @@ // now make windows overlap window2->move(window1->pos()); - QCOMPARE(window1->geometry(), window2->geometry()); + QCOMPARE(window1->frameGeometry(), window2->frameGeometry()); // enter kwinApp()->platform()->pointerMotion(QPointF(25, 25), 1); diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -232,7 +232,7 @@ QVERIFY(c->isInternal()); QVERIFY(!c->isDecorated()); QCOMPARE(workspace()->findInternal(&win), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 100)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 100)); QVERIFY(c->isShown(false)); QVERIFY(workspace()->xStackingOrder().contains(c)); @@ -539,15 +539,15 @@ QTRY_COMPARE(clientAddedSpy.count(), 1); auto internalClient = clientAddedSpy.first().first().value(); QVERIFY(internalClient); - QCOMPARE(internalClient->geometry(), QRect(0, 0, 100, 100)); + QCOMPARE(internalClient->frameGeometry(), QRect(0, 0, 100, 100)); // normal move should be synced internalClient->move(5, 10); - QCOMPARE(internalClient->geometry(), QRect(5, 10, 100, 100)); + QCOMPARE(internalClient->frameGeometry(), QRect(5, 10, 100, 100)); QTRY_COMPARE(win.geometry(), QRect(5, 10, 100, 100)); // another move should also be synced internalClient->move(10, 20); - QCOMPARE(internalClient->geometry(), QRect(10, 20, 100, 100)); + QCOMPARE(internalClient->frameGeometry(), QRect(10, 20, 100, 100)); QTRY_COMPARE(win.geometry(), QRect(10, 20, 100, 100)); // now move with a Geometry update blocker @@ -619,7 +619,7 @@ QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); // move cursor on window - Cursor::setPos(internalClient->geometry().center()); + Cursor::setPos(internalClient->frameGeometry().center()); // simulate modifier+click quint32 timestamp = 1; @@ -655,7 +655,7 @@ workspace()->slotReconfigure(); // move cursor on window - Cursor::setPos(internalClient->geometry().center()); + Cursor::setPos(internalClient->frameGeometry().center()); // set the opacity to 0.5 internalClient->setOpacity(0.5); diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -239,33 +239,33 @@ // first move cursor into the center of the window quint32 timestamp = 1; - MOTION(c->geometry().center()); + MOTION(c->frameGeometry().center()); QVERIFY(enteredSpy.wait()); LOCK QVERIFY(leftSpy.wait()); QCOMPARE(leftSpy.count(), 1); // simulate moving out in and out again - MOTION(c->geometry().center()); - MOTION(c->geometry().bottomRight() + QPoint(100, 100)); - MOTION(c->geometry().bottomRight() + QPoint(100, 100)); + MOTION(c->frameGeometry().center()); + MOTION(c->frameGeometry().bottomRight() + QPoint(100, 100)); + MOTION(c->frameGeometry().bottomRight() + QPoint(100, 100)); QVERIFY(!leftSpy.wait()); QCOMPARE(leftSpy.count(), 1); QCOMPARE(enteredSpy.count(), 1); // go back on the window - MOTION(c->geometry().center()); + MOTION(c->frameGeometry().center()); // and unlock UNLOCK QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 2); // move on the window - MOTION(c->geometry().center() + QPoint(100, 100)); + MOTION(c->frameGeometry().center() + QPoint(100, 100)); QVERIFY(leftSpy.wait()); - MOTION(c->geometry().center()); + MOTION(c->frameGeometry().center()); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 3); } @@ -286,7 +286,7 @@ // first move cursor into the center of the window quint32 timestamp = 1; - MOTION(c->geometry().center()); + MOTION(c->frameGeometry().center()); QVERIFY(enteredSpy.wait()); // and simulate a click PRESS; @@ -329,7 +329,7 @@ // first move cursor into the center of the window quint32 timestamp = 1; - MOTION(c->geometry().center()); + MOTION(c->frameGeometry().center()); QVERIFY(enteredSpy.wait()); // and simulate axis kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++); diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -204,7 +204,7 @@ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); - QCOMPARE(client->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 100, 50)); QEXPECT_FAIL("", "Should go out of maximzied", Continue); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); @@ -264,7 +264,7 @@ QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); // Maximize the client. - const QRect maximizeRestoreGeometry = client->geometry(); + const QRect maximizeRestoreGeometry = client->frameGeometry(); workspace()->slotWindowMaximize(); QVERIFY(configureRequestedSpy.wait()); QCOMPARE(configureRequestedSpy.count(), 3); @@ -278,7 +278,7 @@ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(client->isDecorated(), false); @@ -295,7 +295,7 @@ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::red); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), maximizeRestoreGeometry); + QCOMPARE(client->frameGeometry(), maximizeRestoreGeometry); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->isDecorated(), true); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -137,7 +137,7 @@ QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); QVERIFY(geometryChangedSpy.isValid()); QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); @@ -188,16 +188,16 @@ c->updateMoveResize(Cursor::pos()); QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); QCOMPARE(windowStepUserMovedResizedSpy.count(), 2); - QCOMPARE(c->geometry(), QRect(16, 32, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(16, 32, 100, 50)); QCOMPARE(Cursor::pos(), cursorPos + QPoint(16, 32)); // let's end QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); c->keyPressEvent(Qt::Key_Enter); QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); QCOMPARE(moveResizedChangedSpy.count(), 2); QCOMPARE(windowFinishUserMovedResizedSpy.count(), 1); - QCOMPARE(c->geometry(), QRect(16, 32, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(16, 32, 100, 50)); QCOMPARE(c->isMove(), false); QVERIFY(workspace()->moveResizeClient() == nullptr); surface.reset(); @@ -242,7 +242,7 @@ QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); QVERIFY(geometryChangedSpy.isValid()); QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); @@ -290,7 +290,7 @@ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(108, 50), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(c->geometry(), QRect(0, 0, 108, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 50)); QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); // Go down. @@ -311,7 +311,7 @@ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(108, 58), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(c->geometry(), QRect(0, 0, 108, 58)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 58)); QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); // Let's finalize the resize operation. @@ -360,15 +360,15 @@ QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); // let's place it centered Placement::self()->placeCentered(c, QRect(0, 0, 1280, 1024)); - QCOMPARE(c->geometry(), QRect(590, 487, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(590, 487, 100, 50)); QFETCH(QString, methodCall); QMetaObject::invokeMethod(workspace(), methodCall.toLocal8Bit().constData()); - QTEST(c->geometry(), "expectedGeometry"); + QTEST(c->frameGeometry(), "expectedGeometry"); surface.reset(); QVERIFY(Test::waitForWindowDestroyed(c)); } @@ -411,12 +411,12 @@ QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry().size(), QSize(10, 10)); + QCOMPARE(c->frameGeometry().size(), QSize(10, 10)); // let's place it centered Placement::self()->placeCentered(c, QRect(0, 0, 1280, 1024)); - QCOMPARE(c->geometry(), QRect(635, 507, 10, 10)); + QCOMPARE(c->frameGeometry(), QRect(635, 507, 10, 10)); QMetaObject::invokeMethod(workspace(), methodCall.toLocal8Bit().constData()); - QCOMPARE(c->geometry(), expectedGeometry); + QCOMPARE(c->frameGeometry(), expectedGeometry); }; renderWindow(surface1.data(), QStringLiteral("slotWindowPackLeft"), QRect(0, 507, 10, 10)); renderWindow(surface2.data(), QStringLiteral("slotWindowPackUp"), QRect(635, 0, 10, 10)); @@ -433,11 +433,11 @@ QCOMPARE(workspace()->activeClient(), c); // let's place it centered Placement::self()->placeCentered(c, QRect(0, 0, 1280, 1024)); - QCOMPARE(c->geometry(), QRect(590, 487, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(590, 487, 100, 50)); QFETCH(QString, methodCall); QMetaObject::invokeMethod(workspace(), methodCall.toLocal8Bit().constData()); - QTEST(c->geometry(), "expectedGeometry"); + QTEST(c->frameGeometry(), "expectedGeometry"); } void MoveResizeWindowTest::testGrowShrink_data() @@ -480,7 +480,7 @@ // let's place it centered Placement::self()->placeCentered(c, QRect(0, 0, 1280, 1024)); - QCOMPARE(c->geometry(), QRect(590, 487, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(590, 487, 100, 50)); QFETCH(QString, methodCall); QMetaObject::invokeMethod(workspace(), methodCall.toLocal8Bit().constData()); @@ -491,7 +491,7 @@ QVERIFY(geometryChangedSpy.isValid()); m_connection->flush(); QVERIFY(geometryChangedSpy.wait()); - QTEST(c->geometry(), "expectedGeometry"); + QTEST(c->frameGeometry(), "expectedGeometry"); } void MoveResizeWindowTest::testPointerMoveEnd_data() @@ -578,7 +578,7 @@ QVERIFY(c); // move pointer into center of geometry - const QRect startGeometry = c->geometry(); + const QRect startGeometry = c->frameGeometry(); Cursor::setPos(startGeometry.center()); QVERIFY(pointerEnteredSpy.wait()); QCOMPARE(pointerEnteredSpy.first().last().toPoint(), QPoint(49, 24)); @@ -606,7 +606,7 @@ kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); QVERIFY(pointerEnteredSpy.wait()); QCOMPARE(c->isMove(), false); - QCOMPARE(c->geometry(), startGeometry.translated(QPoint(dragDistance, dragDistance) + QPoint(6, 6))); + QCOMPARE(c->frameGeometry(), startGeometry.translated(QPoint(dragDistance, dragDistance) + QPoint(6, 6))); QCOMPARE(pointerEnteredSpy.last().last().toPoint(), QPoint(49, 24)); } @@ -684,7 +684,7 @@ X11Client *client = windowCreatedSpy.first().first().value(); QVERIFY(client); QCOMPARE(client->window(), w); - const QRect origGeo = client->geometry(); + const QRect origGeo = client->frameGeometry(); // let's move the cursor outside the window Cursor::setPos(screens()->geometry(0).center()); @@ -715,7 +715,7 @@ QCOMPARE(moveStepSpy.first().last().toRect(), origGeo.translated(10, 10)); // let's cancel the move resize again through the net API - root.moveResizeRequest(w, client->geometry().center().x(), client->geometry().center().y(), NET::MoveResizeCancel); + root.moveResizeRequest(w, client->frameGeometry().center().x(), client->frameGeometry().center().y(), NET::MoveResizeCancel); xcb_flush(c.data()); QVERIFY(moveEndSpy.wait()); @@ -773,7 +773,7 @@ X11Client *panel = windowCreatedSpy.first().first().value(); QVERIFY(panel); QCOMPARE(panel->window(), w); - QCOMPARE(panel->geometry(), panelGeometry); + QCOMPARE(panel->frameGeometry(), panelGeometry); QVERIFY(panel->isDock()); // let's create a window @@ -855,7 +855,7 @@ // let's render auto panel = Test::renderAndWaitForShown(panelSurface.data(), panelGeometry.size(), Qt::blue); QVERIFY(panel); - QCOMPARE(panel->geometry(), panelGeometry); + QCOMPARE(panel->frameGeometry(), panelGeometry); QVERIFY(panel->isDock()); // let's create a window @@ -923,24 +923,24 @@ QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); QVERIFY(geometryChangedSpy.isValid()); - QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); + QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(100, 0, 500, 101)); + QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); client->setVirtualKeyboardGeometry(QRect()); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); + QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); } void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() @@ -966,22 +966,22 @@ QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); QVERIFY(geometryChangedSpy.isValid()); - QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); + QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(100, 0, 500, 101)); + QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); client->setMaximize(true, true); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); client->setVirtualKeyboardGeometry(QRect()); QVERIFY(!configureRequestedSpy.wait(10)); @@ -991,7 +991,7 @@ QVERIFY(!geometryChangedSpy.wait(10)); // Size will NOT be restored - QCOMPARE(client->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); } void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() @@ -1017,31 +1017,31 @@ QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); QVERIFY(geometryChangedSpy.isValid()); - QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); + QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(100, 0, 500, 101)); + QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); client->setFullScreen(true, true); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(client->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); client->setVirtualKeyboardGeometry(QRect()); QVERIFY(!configureRequestedSpy.wait(10)); // render at the size of the configureRequested.. it won't have changed Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); QVERIFY(!geometryChangedSpy.wait(10)); // Size will NOT be restored - QCOMPARE(client->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); } void MoveResizeWindowTest::testDestroyMoveClient() diff --git a/autotests/integration/placement_test.cpp b/autotests/integration/placement_test.cpp --- a/autotests/integration/placement_test.cpp +++ b/autotests/integration/placement_test.cpp @@ -138,7 +138,7 @@ auto c = Test::renderAndWaitForShown(surface, size, Qt::red); - rc.finalGeometry = c->geometry(); + rc.finalGeometry = c->frameGeometry(); return rc; } @@ -217,7 +217,7 @@ QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); QVERIFY(client); - QCOMPARE(client->geometry(), QRect(590, 487, 100, 50)); + QCOMPARE(client->frameGeometry(), QRect(590, 487, 100, 50)); shellSurface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); @@ -239,7 +239,7 @@ QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); QVERIFY(client); - QCOMPARE(client->geometry(), QRect(151, 276, 100, 50)); + QCOMPARE(client->frameGeometry(), QRect(151, 276, 100, 50)); shellSurface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -223,7 +223,7 @@ QVERIFY(c); QCOMPARE(c->windowType(), NET::OnScreenDisplay); QVERIFY(c->isOnScreenDisplay()); - QCOMPARE(c->geometry(), QRect(590, 649, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(590, 649, 100, 50)); // change the screen size QSignalSpy screensChangedSpy(screens(), &Screens::changed); @@ -239,14 +239,14 @@ QCOMPARE(screens()->geometry(0), geometries.at(0)); QCOMPARE(screens()->geometry(1), geometries.at(1)); - QCOMPARE(c->geometry(), QRect(590, 649, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(590, 649, 100, 50)); // change size of window QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryShapeChanged); QVERIFY(geometryChangedSpy.isValid()); Test::render(surface.data(), QSize(200, 100), Qt::red); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(c->geometry(), QRect(540, 616, 200, 100)); + QCOMPARE(c->frameGeometry(), QRect(540, 616, 200, 100)); } void PlasmaSurfaceTest::testOSDPlacementManualPosition_data() @@ -278,7 +278,7 @@ QVERIFY(c->isInitialPositionSet()); QCOMPARE(c->windowType(), NET::OnScreenDisplay); QVERIFY(c->isOnScreenDisplay()); - QCOMPARE(c->geometry(), QRect(50, 70, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(50, 70, 100, 50)); } @@ -320,7 +320,7 @@ QVERIFY(c); QCOMPARE(c->windowType(), NET::Dock); QVERIFY(c->isDock()); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QTEST(c->hasStrut(), "expectedStrut"); QTEST(workspace()->clientArea(MaximizeArea, 0, 0), "expectedMaxArea"); QTEST(c->layer(), "expectedLayer"); @@ -367,7 +367,7 @@ QVERIFY(panel); QCOMPARE(panel->windowType(), NET::Dock); QVERIFY(panel->isDock()); - QCOMPARE(panel->geometry(), panelGeometry); + QCOMPARE(panel->frameGeometry(), panelGeometry); QCOMPARE(panel->hasStrut(), false); QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 0), QRect(0, 0, 1280, 1024)); QCOMPARE(panel->layer(), KWin::NormalLayer); @@ -386,7 +386,7 @@ QVERIFY(c->isActive()); QCOMPARE(c->layer(), KWin::NormalLayer); c->move(windowGeometry.topLeft()); - QCOMPARE(c->geometry(), windowGeometry); + QCOMPARE(c->frameGeometry(), windowGeometry); auto stackingOrder = workspace()->stackingOrder(); QCOMPARE(stackingOrder.count(), 2); diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -158,7 +158,7 @@ QCOMPARE(plasmaWindowCreatedSpy.count(), 1); QCOMPARE(m_windowManagement->windows().count(), 1); auto pw = m_windowManagement->windows().first(); - QCOMPARE(pw->geometry(), client->geometry()); + QCOMPARE(pw->geometry(), client->frameGeometry()); QSignalSpy geometryChangedSpy(pw, &PlasmaWindow::geometryChanged); QVERIFY(geometryChangedSpy.isValid()); @@ -168,18 +168,18 @@ QVERIFY(destroyedSpy.isValid()); // now shade the window - const QRect geoBeforeShade = client->geometry(); + const QRect geoBeforeShade = client->frameGeometry(); QVERIFY(geoBeforeShade.isValid()); QVERIFY(!geoBeforeShade.isEmpty()); workspace()->slotWindowShade(); QVERIFY(client->isShade()); - QVERIFY(client->geometry() != geoBeforeShade); + QVERIFY(client->frameGeometry() != geoBeforeShade); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(pw->geometry(), client->geometry()); + QCOMPARE(pw->geometry(), client->frameGeometry()); // and unshade again workspace()->slotWindowShade(); QVERIFY(!client->isShade()); - QCOMPARE(client->geometry(), geoBeforeShade); + QCOMPARE(client->frameGeometry(), geoBeforeShade); QVERIFY(geometryChangedSpy.wait()); QCOMPARE(pw->geometry(), geoBeforeShade); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -146,27 +146,27 @@ // now map the window auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 100), Qt::blue); QVERIFY(c); - if (c->geometry().topLeft() == QPoint(0, 0)) { + if (c->pos() == QPoint(0, 0)) { c->move(QPoint(1, 1)); } - QVERIFY(!c->geometry().contains(KWin::Cursor::pos())); + QVERIFY(!c->frameGeometry().contains(KWin::Cursor::pos())); // now let's confine QCOMPARE(input()->pointer()->isConstrained(), false); - KWin::Cursor::setPos(c->geometry().center()); + KWin::Cursor::setPos(c->frameGeometry().center()); QCOMPARE(input()->pointer()->isConstrained(), true); QVERIFY(confinedSpy.wait()); // picking a position outside the window geometry should not move pointer QSignalSpy pointerPositionChangedSpy(input(), &InputRedirection::globalPointerChanged); QVERIFY(pointerPositionChangedSpy.isValid()); KWin::Cursor::setPos(QPoint(1280, 512)); QVERIFY(pointerPositionChangedSpy.isEmpty()); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); // TODO: test relative motion QFETCH(PointerFunc, positionFunction); - const QPoint position = positionFunction(c->geometry()); + const QPoint position = positionFunction(c->frameGeometry()); KWin::Cursor::setPos(position); QCOMPARE(pointerPositionChangedSpy.count(), 1); QCOMPARE(KWin::Cursor::pos(), position); @@ -314,28 +314,28 @@ // now map the window auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 100), Qt::blue); QVERIFY(c); - QVERIFY(!c->geometry().contains(KWin::Cursor::pos())); + QVERIFY(!c->frameGeometry().contains(KWin::Cursor::pos())); // now let's lock QCOMPARE(input()->pointer()->isConstrained(), false); - KWin::Cursor::setPos(c->geometry().center()); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); + KWin::Cursor::setPos(c->frameGeometry().center()); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); QCOMPARE(input()->pointer()->isConstrained(), true); QVERIFY(lockedSpy.wait()); // try to move the pointer // TODO: add relative pointer - KWin::Cursor::setPos(c->geometry().center() + QPoint(1, 1)); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); + KWin::Cursor::setPos(c->frameGeometry().center() + QPoint(1, 1)); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); // deactivate the client, this should unlock workspace()->activateClient(nullptr); QCOMPARE(input()->pointer()->isConstrained(), false); QVERIFY(unlockedSpy.wait()); // moving cursor should be allowed again - KWin::Cursor::setPos(c->geometry().center() + QPoint(1, 1)); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center() + QPoint(1, 1)); + KWin::Cursor::setPos(c->frameGeometry().center() + QPoint(1, 1)); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center() + QPoint(1, 1)); lockedPointer.reset(Test::waylandPointerConstraints()->lockPointer(surface.data(), pointer.data(), nullptr, PointerConstraints::LifeTime::Persistent)); QSignalSpy lockedSpy2(lockedPointer.data(), &LockedPointer::locked); @@ -348,8 +348,8 @@ // try to move the pointer QCOMPARE(input()->pointer()->isConstrained(), true); - KWin::Cursor::setPos(c->geometry().center()); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center() + QPoint(1, 1)); + KWin::Cursor::setPos(c->frameGeometry().center()); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center() + QPoint(1, 1)); // delete pointer lock lockedPointer.reset(nullptr); @@ -361,8 +361,8 @@ // moving cursor should be allowed again QCOMPARE(input()->pointer()->isConstrained(), false); - KWin::Cursor::setPos(c->geometry().center()); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); + KWin::Cursor::setPos(c->frameGeometry().center()); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); } void TestPointerConstraints::testCloseWindowWithLockedPointer_data() @@ -389,12 +389,12 @@ // now map the window auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 100), Qt::blue); QVERIFY(c); - QVERIFY(!c->geometry().contains(KWin::Cursor::pos())); + QVERIFY(!c->frameGeometry().contains(KWin::Cursor::pos())); // now let's lock QCOMPARE(input()->pointer()->isConstrained(), false); - KWin::Cursor::setPos(c->geometry().center()); - QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); + KWin::Cursor::setPos(c->frameGeometry().center()); + QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); QCOMPARE(input()->pointer()->isConstrained(), true); QVERIFY(lockedSpy.wait()); diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -305,7 +305,7 @@ QVERIFY(window); QCOMPARE(window->pos(), QPoint(0, 0)); - QVERIFY(window->geometry().contains(Cursor::pos())); + QVERIFY(window->frameGeometry().contains(Cursor::pos())); // is PresentWindows effect for top left screen edge loaded QVERIFY(static_cast(effects)->isEffectLoaded("presentwindows")); @@ -346,7 +346,7 @@ QVERIFY(clientAddedSpy.wait()); AbstractClient *window = workspace()->activeClient(); QVERIFY(window); - QVERIFY(!window->geometry().contains(Cursor::pos())); + QVERIFY(!window->frameGeometry().contains(Cursor::pos())); QSignalSpy screensChangedSpy(screens(), &Screens::changed); QVERIFY(screensChangedSpy.isValid()); @@ -360,7 +360,7 @@ // this should have warped the cursor QCOMPARE(Cursor::pos(), QPoint(639, 511)); - QVERIFY(window->geometry().contains(Cursor::pos())); + QVERIFY(window->frameGeometry().contains(Cursor::pos())); // and we should get an enter event QTRY_COMPARE(enteredSpy.count(), 1); @@ -444,7 +444,7 @@ QVERIFY(window); // move cursor on window - Cursor::setPos(window->geometry().center()); + Cursor::setPos(window->frameGeometry().center()); // simulate modifier+click quint32 timestamp = 1; @@ -516,7 +516,7 @@ QVERIFY(workspace()->globalShortcutsDisabled()); // move cursor on window - Cursor::setPos(window->geometry().center()); + Cursor::setPos(window->frameGeometry().center()); // simulate modifier+click quint32 timestamp = 1; @@ -587,7 +587,7 @@ QCOMPARE(window->opacity(), 0.5); // move cursor on window - Cursor::setPos(window->geometry().center()); + Cursor::setPos(window->frameGeometry().center()); // simulate modifier+wheel quint32 timestamp = 1; @@ -646,7 +646,7 @@ QCOMPARE(window->opacity(), 0.5); // move cursor on window - Cursor::setPos(window->geometry().center()); + Cursor::setPos(window->frameGeometry().center()); // disable global shortcuts QVERIFY(!workspace()->globalShortcutsDisabled()); @@ -702,7 +702,7 @@ QVERIFY(window1 != window2); // move cursor to the inactive window - Cursor::setPos(window1->geometry().center()); + Cursor::setPos(window1->frameGeometry().center()); quint32 timestamp = 1; QVERIFY(!window1->isActive()); @@ -762,7 +762,7 @@ QVERIFY(window1 != window2); QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); // geometry of the two windows should be overlapping - QVERIFY(window1->geometry().intersects(window2->geometry())); + QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry())); // signal spies for active window changed and stacking order changed QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::clientActivated); @@ -774,8 +774,8 @@ QVERIFY(window2->isActive()); // move on top of first window - QVERIFY(window1->geometry().contains(10, 10)); - QVERIFY(!window2->geometry().contains(10, 10)); + QVERIFY(window1->frameGeometry().contains(10, 10)); + QVERIFY(!window2->frameGeometry().contains(10, 10)); Cursor::setPos(10, 10); QVERIFY(stackingOrderChangedSpy.wait()); QCOMPARE(stackingOrderChangedSpy.count(), 1); @@ -848,7 +848,7 @@ QVERIFY(window1 != window2); QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); // geometry of the two windows should be overlapping - QVERIFY(window1->geometry().intersects(window2->geometry())); + QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry())); // signal spies for active window changed and stacking order changed QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::clientActivated); @@ -860,8 +860,8 @@ QVERIFY(window2->isActive()); // move on top of first window - QVERIFY(window1->geometry().contains(10, 10)); - QVERIFY(!window2->geometry().contains(10, 10)); + QVERIFY(window1->frameGeometry().contains(10, 10)); + QVERIFY(!window2->frameGeometry().contains(10, 10)); Cursor::setPos(10, 10); // no focus follows mouse QVERIFY(!stackingOrderChangedSpy.wait(200)); @@ -942,7 +942,7 @@ QVERIFY(window2DestroyedSpy.isValid()); QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); // geometry of the two windows should be overlapping - QVERIFY(window1->geometry().intersects(window2->geometry())); + QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry())); // lower the currently active window workspace()->lowerClient(window2); QCOMPARE(workspace()->topClientOnDesktop(1, -1), window1); @@ -952,8 +952,8 @@ QVERIFY(stackingOrderChangedSpy.isValid()); // move on top of second window - QVERIFY(!window1->geometry().contains(900, 900)); - QVERIFY(window2->geometry().contains(900, 900)); + QVERIFY(!window1->frameGeometry().contains(900, 900)); + QVERIFY(window2->frameGeometry().contains(900, 900)); Cursor::setPos(900, 900); // and click @@ -1010,7 +1010,7 @@ QVERIFY(window); // move cursor to center of window, this should first set a null pointer, so we still show old cursor - Cursor::setPos(window->geometry().center()); + Cursor::setPos(window->frameGeometry().center()); QCOMPARE(p->focus().data(), window); QCOMPARE(p->cursorImage(), fallbackCursor); QVERIFY(enteredSpy.wait()); @@ -1065,7 +1065,7 @@ QTRY_VERIFY(p->cursorImage().isNull()); // move cursor somewhere else, should reset to fallback cursor - Cursor::setPos(window->geometry().bottomLeft() + QPoint(20, 20)); + Cursor::setPos(window->frameGeometry().bottomLeft() + QPoint(20, 20)); QVERIFY(p->focus().isNull()); QVERIFY(!p->cursorImage().isNull()); QCOMPARE(p->cursorImage(), fallbackCursor); @@ -1111,8 +1111,8 @@ QVERIFY(window); // and move cursor to the window - QVERIFY(!window->geometry().contains(QPoint(800, 800))); - Cursor::setPos(window->geometry().center()); + QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); + Cursor::setPos(window->frameGeometry().center()); QVERIFY(enteredSpy.wait()); // cursor image should still be fallback QCOMPARE(p->cursorImage(), fallback); @@ -1144,7 +1144,7 @@ QCOMPARE(p->cursorImage(), sizeAll); // move cursor to area of window - Cursor::setPos(window->geometry().center()); + Cursor::setPos(window->frameGeometry().center()); // this should not result in an enter event QVERIFY(!enteredSpy.wait(100)); @@ -1187,8 +1187,8 @@ QVERIFY(window); QCOMPARE(window->hasPopupGrab(), false); // move pointer into window - QVERIFY(!window->geometry().contains(QPoint(800, 800))); - Cursor::setPos(window->geometry().center()); + QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); + Cursor::setPos(window->frameGeometry().center()); QVERIFY(enteredSpy.wait()); // click inside window to create serial quint32 timestamp = 0; @@ -1218,15 +1218,15 @@ QCOMPARE(popupClient->hasPopupGrab(), true); // let's move the pointer into the center of the window - Cursor::setPos(popupClient->geometry().center()); + Cursor::setPos(popupClient->frameGeometry().center()); QVERIFY(enteredSpy.wait()); QCOMPARE(enteredSpy.count(), 2); QCOMPARE(leftSpy.count(), 1); QCOMPARE(pointer->enteredSurface(), popupSurface); // let's move the pointer outside of the popup window // this should not really change anything, it gets a leave event - Cursor::setPos(popupClient->geometry().bottomRight() + QPoint(2, 2)); + Cursor::setPos(popupClient->frameGeometry().bottomRight() + QPoint(2, 2)); QVERIFY(leftSpy.wait()); QCOMPARE(leftSpy.count(), 2); QVERIFY(popupDoneSpy.isEmpty()); @@ -1278,8 +1278,8 @@ QVERIFY(window->isDecorated()); // move pointer into window - QVERIFY(!window->geometry().contains(QPoint(800, 800))); - Cursor::setPos(window->geometry().center()); + QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); + Cursor::setPos(window->frameGeometry().center()); QVERIFY(enteredSpy.wait()); // click inside window to create serial quint32 timestamp = 0; @@ -1309,7 +1309,7 @@ QCOMPARE(popupClient->hasPopupGrab(), true); // let's move the pointer into the center of the deco - Cursor::setPos(window->geometry().center().x(), window->y() + (window->height() - window->clientSize().height()) / 2); + Cursor::setPos(window->frameGeometry().center().x(), window->y() + (window->height() - window->clientSize().height()) / 2); kwinApp()->platform()->pointerButtonPressed(BTN_RIGHT, timestamp++); QVERIFY(popupDoneSpy.wait()); @@ -1345,8 +1345,8 @@ QVERIFY(window); // move cursor over window - QVERIFY(!window->geometry().contains(QPoint(800, 800))); - Cursor::setPos(window->geometry().center()); + QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); + Cursor::setPos(window->frameGeometry().center()); QVERIFY(enteredSpy.wait()); // click inside window quint32 timestamp = 0; @@ -1365,8 +1365,8 @@ auto popupClient = clientAddedSpy.last().first().value(); QVERIFY(popupClient); QVERIFY(popupClient != window); - QVERIFY(window->geometry().contains(Cursor::pos())); - QVERIFY(popupClient->geometry().contains(Cursor::pos())); + QVERIFY(window->frameGeometry().contains(Cursor::pos())); + QVERIFY(popupClient->frameGeometry().contains(Cursor::pos())); QVERIFY(!leftSpy.wait()); kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); @@ -1509,19 +1509,19 @@ QFETCH(Qt::Edges, edges); if (edges & Qt::LeftEdge) { - cursorPos.setX(c->geometry().left()); + cursorPos.setX(c->frameGeometry().left()); } else if (edges & Qt::RightEdge) { - cursorPos.setX(c->geometry().right()); + cursorPos.setX(c->frameGeometry().right()); } else { - cursorPos.setX(c->geometry().center().x()); + cursorPos.setX(c->frameGeometry().center().x()); } if (edges & Qt::TopEdge) { - cursorPos.setY(c->geometry().top()); + cursorPos.setY(c->frameGeometry().top()); } else if (edges & Qt::BottomEdge) { - cursorPos.setY(c->geometry().bottom()); + cursorPos.setY(c->frameGeometry().bottom()); } else { - cursorPos.setY(c->geometry().center().y()); + cursorPos.setY(c->frameGeometry().center().y()); } Cursor::setPos(cursorPos); @@ -1575,7 +1575,7 @@ QVERIFY(c); // move cursor to the test position - Cursor::setPos(c->geometry().center()); + Cursor::setPos(c->frameGeometry().center()); const PlatformCursorImage arrowCursor = loadReferenceThemeCursor(Qt::ArrowCursor); QVERIFY(!arrowCursor.image().isNull()); diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -169,7 +169,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); // We have to receive a configure event when the client becomes active. @@ -188,7 +188,7 @@ c->setQuickTileMode(mode, true); QCOMPARE(quickTileChangedSpy.count(), 1); // at this point the geometry did not yet change - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); // but quick tile mode already changed QCOMPARE(c->quickTileMode(), mode); @@ -205,15 +205,15 @@ QVERIFY(geometryChangedSpy.wait()); QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue); QCOMPARE(geometryChangedSpy.count(), 1); - QCOMPARE(c->geometry(), expectedGeometry); + QCOMPARE(c->frameGeometry(), expectedGeometry); // send window to other screen QCOMPARE(c->screen(), 0); c->sendToScreen(1); QCOMPARE(c->screen(), 1); // quick tile should not be changed QCOMPARE(c->quickTileMode(), mode); - QTEST(c->geometry(), "secondScreen"); + QTEST(c->frameGeometry(), "secondScreen"); // now try to toggle again c->setQuickTileMode(mode, true); @@ -245,7 +245,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); QCOMPARE(c->maximizeMode(), MaximizeRestore); @@ -268,7 +268,7 @@ QCOMPARE(quickTileChangedSpy.count(), 1); // at this point the geometry did not yet change - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); // but quick tile mode already changed QCOMPARE(c->quickTileMode(), QuickTileFlag::Maximize); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); @@ -285,7 +285,7 @@ QVERIFY(geometryChangedSpy.wait()); QCOMPARE(geometryChangedSpy.count(), 2); - QCOMPARE(c->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); // client is now set to maximised @@ -304,7 +304,7 @@ QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); QCOMPARE(quickTileChangedSpy.count(), 2); // geometry not yet changed - QCOMPARE(c->geometry(), QRect(0, 0, 1280, 1024)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); // we got requested a new geometry QVERIFY(configureRequestedSpy.wait()); @@ -318,7 +318,7 @@ QVERIFY(geometryChangedSpy.wait()); QCOMPARE(geometryChangedSpy.count(), 4); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); QCOMPARE(maximizeChangedSpy1.count(), 2); QCOMPARE(maximizeChangedSpy1.last().first().value(), c); @@ -358,7 +358,7 @@ QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); QCOMPARE(c->maximizeMode(), MaximizeRestore); @@ -435,7 +435,7 @@ QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); QCOMPARE(c->maximizeMode(), MaximizeRestore); @@ -509,9 +509,9 @@ QVERIFY(c->isDecorated()); const auto decoration = c->decoration(); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(-decoration->borderLeft(), 0, - 1000 + decoration->borderLeft() + decoration->borderRight(), - 50 + decoration->borderTop() + decoration->borderBottom())); + QCOMPARE(c->frameGeometry(), QRect(-decoration->borderLeft(), 0, + 1000 + decoration->borderLeft() + decoration->borderRight(), + 50 + decoration->borderTop() + decoration->borderBottom())); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); QCOMPARE(c->maximizeMode(), MaximizeRestore); @@ -523,7 +523,7 @@ QVERIFY(quickTileChangedSpy.isValid()); quint32 timestamp = 1; - kwinApp()->platform()->touchDown(0, QPointF(c->geometry().center().x(), c->geometry().y() + decoration->borderTop() / 2), timestamp++); + kwinApp()->platform()->touchDown(0, QPointF(c->frameGeometry().center().x(), c->frameGeometry().y() + decoration->borderTop() / 2), timestamp++); QVERIFY(configureRequestedSpy.wait()); QCOMPARE(c, workspace()->moveResizeClient()); QCOMPARE(configureRequestedSpy.count(), 3); @@ -607,11 +607,11 @@ // now quick tile QSignalSpy quickTileChangedSpy(client, &AbstractClient::quickTileModeChanged); QVERIFY(quickTileChangedSpy.isValid()); - const QRect origGeo = client->geometry(); + const QRect origGeo = client->frameGeometry(); QFETCH(QuickTileMode, mode); client->setQuickTileMode(mode, true); QCOMPARE(client->quickTileMode(), mode); - QTEST(client->geometry(), "expectedGeometry"); + QTEST(client->frameGeometry(), "expectedGeometry"); QCOMPARE(client->geometryRestore(), origGeo); QEXPECT_FAIL("maximize", "For maximize we get two changed signals", Continue); QCOMPARE(quickTileChangedSpy.count(), 1); @@ -684,11 +684,11 @@ QVERIFY(client); QCOMPARE(client->window(), w); - const QRect origGeo = client->geometry(); + const QRect origGeo = client->frameGeometry(); QCOMPARE(client->maximizeMode(), MaximizeRestore); // vertically maximize the window client->maximize(client->maximizeMode() ^ MaximizeVertical); - QCOMPARE(client->geometry().width(), origGeo.width()); + QCOMPARE(client->frameGeometry().width(), origGeo.width()); QCOMPARE(client->height(), screens()->size(client->screen()).height()); QCOMPARE(client->geometryRestore(), origGeo); @@ -698,7 +698,7 @@ QFETCH(QuickTileMode, mode); client->setQuickTileMode(mode, true); QCOMPARE(client->quickTileMode(), mode); - QTEST(client->geometry(), "expectedGeometry"); + QTEST(client->frameGeometry(), "expectedGeometry"); QEXPECT_FAIL("", "We get two changed events", Continue); QCOMPARE(quickTileChangedSpy.count(), 1); @@ -746,7 +746,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); // We have to receive a configure event when the client becomes active. @@ -772,7 +772,7 @@ QVERIFY(quickTileChangedSpy.wait()); QCOMPARE(quickTileChangedSpy.count(), 1); // at this point the geometry did not yet change - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); // but quick tile mode already changed QTEST(c->quickTileMode(), "expectedMode"); @@ -790,7 +790,7 @@ QVERIFY(geometryChangedSpy.wait()); QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue); QCOMPARE(geometryChangedSpy.count(), 1); - QCOMPARE(c->geometry(), expectedGeometry); + QCOMPARE(c->frameGeometry(), expectedGeometry); } void QuickTilingTest::testScript_data() @@ -826,7 +826,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); // We have to receive a configure event upon the client becoming active. @@ -868,7 +868,7 @@ QCOMPARE(runningChangedSpy.first().first().toBool(), true); // at this point the geometry did not yet change - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); // but quick tile mode already changed QCOMPARE(c->quickTileMode(), expectedMode); @@ -884,7 +884,7 @@ QVERIFY(geometryChangedSpy.wait()); QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue); QCOMPARE(geometryChangedSpy.count(), 1); - QCOMPARE(c->geometry(), expectedGeometry); + QCOMPARE(c->frameGeometry(), expectedGeometry); } } diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -357,7 +357,7 @@ } QVERIFY(client->surface()); QTRY_VERIFY(client->surface()->buffer()); - QTRY_COMPARE(client->surface()->buffer()->data().size(), client->geometry().size()); + QTRY_COMPARE(client->surface()->buffer()->data().size(), client->size()); QImage compareImage(client->clientSize(), QImage::Format_RGB32); compareImage.fill(Qt::white); QCOMPARE(client->surface()->buffer()->data().copy(QRect(client->clientPos(), client->clientSize())), compareImage); diff --git a/autotests/integration/screenedge_client_show_test.cpp b/autotests/integration/screenedge_client_show_test.cpp --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -143,7 +143,7 @@ X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(!client->isDecorated()); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); QVERIFY(!client->hasStrut()); QVERIFY(!client->isHiddenInternal()); @@ -183,7 +183,7 @@ QVERIFY(client->isHiddenInternal()); QFETCH(QRect, resizedWindowGeometry); //resizewhile hidden - client->setGeometry(resizedWindowGeometry); + client->setFrameGeometry(resizedWindowGeometry); //triggerPos shouldn't be valid anymore Cursor::setPos(triggerPos); QVERIFY(client->isHiddenInternal()); @@ -247,7 +247,7 @@ X11Client *client = windowCreatedSpy.last().first().value(); QVERIFY(client); QVERIFY(!client->isDecorated()); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); QVERIFY(!client->hasStrut()); QVERIFY(!client->isHiddenInternal()); diff --git a/autotests/integration/shade_test.cpp b/autotests/integration/shade_test.cpp --- a/autotests/integration/shade_test.cpp +++ b/autotests/integration/shade_test.cpp @@ -115,16 +115,16 @@ QVERIFY(client->isActive()); // now shade the window - const QRect geoBeforeShade = client->geometry(); + const QRect geoBeforeShade = client->frameGeometry(); QVERIFY(geoBeforeShade.isValid()); QVERIFY(!geoBeforeShade.isEmpty()); workspace()->slotWindowShade(); QVERIFY(client->isShade()); - QVERIFY(client->geometry() != geoBeforeShade); + QVERIFY(client->frameGeometry() != geoBeforeShade); // and unshade again workspace()->slotWindowShade(); QVERIFY(!client->isShade()); - QCOMPARE(client->geometry(), geoBeforeShade); + QCOMPARE(client->frameGeometry(), geoBeforeShade); // and destroy the window again xcb_unmap_window(c.data(), w); diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -183,7 +183,7 @@ QVERIFY(c); QVERIFY(!c->isActive()); - QCOMPARE(c->geometry(), windowGeometry); + QCOMPARE(c->frameGeometry(), windowGeometry); QVERIFY(c->isDock()); QVERIFY(c->hasStrut()); clients.insert(surface, c); @@ -237,7 +237,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), windowGeometry.size(), Qt::red, QImage::Format_RGB32); QVERIFY(c); QVERIFY(!c->isActive()); - QCOMPARE(c->geometry(), windowGeometry); + QCOMPARE(c->frameGeometry(), windowGeometry); QVERIFY(c->isDock()); QVERIFY(c->hasStrut()); QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1000)); @@ -250,7 +250,7 @@ QVERIFY(geometryChangedSpy.isValid()); plasmaSurface->setPosition(QPoint(1280, 1000)); QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(c->geometry(), QRect(1280, 1000, 1280, 24)); + QCOMPARE(c->frameGeometry(), QRect(1280, 1000, 1280, 24)); QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024)); QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024)); QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1000)); @@ -281,7 +281,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), windowGeometry.size(), Qt::red, QImage::Format_RGB32); QVERIFY(c); QVERIFY(!c->isActive()); - QCOMPARE(c->geometry(), windowGeometry); + QCOMPARE(c->frameGeometry(), windowGeometry); QVERIFY(c->isDock()); QVERIFY(c->hasStrut()); @@ -304,7 +304,7 @@ QVERIFY(c1); QVERIFY(!c1->isActive()); - QCOMPARE(c1->geometry(), windowGeometry2); + QCOMPARE(c1->frameGeometry(), windowGeometry2); QVERIFY(c1->isDock()); QVERIFY(c1->hasStrut()); @@ -605,7 +605,7 @@ QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); QCOMPARE(client->windowType(), NET::Dock); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); // this should have affected the client area // some props are independent of struts - those first @@ -718,7 +718,7 @@ QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); QCOMPARE(client->windowType(), NET::Dock); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); // now verify the actual updated client areas QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), geometries.at(0)); @@ -798,7 +798,7 @@ QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); QCOMPARE(client->windowType(), NET::Dock); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); // now verify the actual updated client areas QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 306, 1366, 744)); @@ -828,7 +828,7 @@ QVERIFY(client2); QVERIFY(client2 != client); QVERIFY(client2->isDecorated()); - QCOMPARE(client2->geometry(), QRect(0, 306, 1366, 744)); + QCOMPARE(client2->frameGeometry(), QRect(0, 306, 1366, 744)); QCOMPARE(client2->maximizeMode(), KWin::MaximizeFull); // destroy window again QSignalSpy normalWindowClosedSpy(client2, &X11Client::windowClosed); @@ -910,7 +910,7 @@ QCOMPARE(client->window(), w); QVERIFY(!client->isDecorated()); QCOMPARE(client->windowType(), NET::Dock); - QCOMPARE(client->geometry(), windowGeometry); + QCOMPARE(client->frameGeometry(), windowGeometry); // now verify the actual updated client areas QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 282, 1366, 768)); @@ -945,7 +945,7 @@ QCOMPARE(client2->clientSize(), QSize(200, 300)); QCOMPARE(client2->pos(), QPoint(1500, 400)); - const QRect origGeo = client2->geometry(); + const QRect origGeo = client2->frameGeometry(); Cursor::setPos(origGeo.center()); workspace()->performWindowOperation(client2, Options::MoveOp); QTRY_COMPARE(workspace()->moveResizeClient(), client2); @@ -958,7 +958,7 @@ client2->keyPressEvent(Qt::Key_Enter); QCOMPARE(client2->isMove(), false); QVERIFY(workspace()->moveResizeClient() == nullptr); - QCOMPARE(client2->geometry(), QRect(origGeo.translated(-800, 0))); + QCOMPARE(client2->frameGeometry(), QRect(origGeo.translated(-800, 0))); } } diff --git a/autotests/integration/touch_input_test.cpp b/autotests/integration/touch_input_test.cpp --- a/autotests/integration/touch_input_test.cpp +++ b/autotests/integration/touch_input_test.cpp @@ -268,7 +268,7 @@ QVERIFY(sequenceStartedSpy.isValid()); quint32 timestamp = 1; - kwinApp()->platform()->touchDown(1, c1->geometry().center(), timestamp++); + kwinApp()->platform()->touchDown(1, c1->frameGeometry().center(), timestamp++); QVERIFY(c1->isActive()); QVERIFY(sequenceStartedSpy.wait()); diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -232,7 +232,7 @@ QVERIFY(!parent->isDecorated()); parent->move(parentPosition); - QCOMPARE(parent->geometry(), QRect(parentPosition, parentSize)); + QCOMPARE(parent->frameGeometry(), QRect(parentPosition, parentSize)); //create popup QFETCH(XdgPositioner, positioner); @@ -254,7 +254,7 @@ QVERIFY(!transient->isDecorated()); QVERIFY(transient->hasTransientPlacementHint()); - QCOMPARE(transient->geometry(), expectedGeometry); + QCOMPARE(transient->frameGeometry(), expectedGeometry); QCOMPARE(configureRequestedSpy.count(), 1); // check that we did not get reconfigured } @@ -279,7 +279,7 @@ QVERIFY(dock); QCOMPARE(dock->windowType(), NET::Dock); QVERIFY(dock->isDock()); - QCOMPARE(dock->geometry(), QRect(0, screens()->geometry(0).height() - 50, 1280, 50)); + QCOMPARE(dock->frameGeometry(), QRect(0, screens()->geometry(0).height() - 50, 1280, 50)); QCOMPARE(dock->hasStrut(), true); QVERIFY(workspace()->clientArea(PlacementArea, 0, 1) != workspace()->clientArea(FullScreenArea, 0, 1)); @@ -294,7 +294,7 @@ QVERIFY(!parent->isDecorated()); parent->move({0, screens()->geometry(0).height() - 600}); parent->keepInArea(workspace()->clientArea(PlacementArea, parent)); - QCOMPARE(parent->geometry(), QRect(0, screens()->geometry(0).height() - 600 - 50, 800, 600)); + QCOMPARE(parent->frameGeometry(), QRect(0, screens()->geometry(0).height() - 600 - 50, 800, 600)); Surface *transientSurface = Test::createSurface(Test::waylandCompositor()); QVERIFY(transientSurface); @@ -307,7 +307,7 @@ QVERIFY(!transient->isDecorated()); QVERIFY(transient->hasTransientPlacementHint()); - QCOMPARE(transient->geometry(), QRect(50, screens()->geometry(0).height() - 200 - 50, 200, 200)); + QCOMPARE(transient->frameGeometry(), QRect(50, screens()->geometry(0).height() - 200 - 50, 200, 200)); transientShellSurface->deleteLater(); transientSurface->deleteLater(); @@ -323,7 +323,7 @@ QVERIFY(geometryShapeChangedSpy.isValid()); Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); QVERIFY(geometryShapeChangedSpy.wait()); - QCOMPARE(parent->geometry(), screens()->geometry(0)); + QCOMPARE(parent->frameGeometry(), screens()->geometry(0)); QVERIFY(parent->isFullScreen()); // another transient, with same hints as before from bottom of window @@ -338,7 +338,7 @@ QVERIFY(!transient->isDecorated()); QVERIFY(transient->hasTransientPlacementHint()); - QCOMPARE(transient->geometry(), QRect(50, screens()->geometry(0).height() - 200, 200, 200)); + QCOMPARE(transient->frameGeometry(), QRect(50, screens()->geometry(0).height() - 200, 200, 200)); } } diff --git a/autotests/integration/window_selection_test.cpp b/autotests/integration/window_selection_test.cpp --- a/autotests/integration/window_selection_test.cpp +++ b/autotests/integration/window_selection_test.cpp @@ -113,7 +113,7 @@ auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(keyboardEnteredSpy.wait()); - KWin::Cursor::setPos(client->geometry().center()); + KWin::Cursor::setPos(client->frameGeometry().center()); QCOMPARE(input()->pointer()->focus().data(), client); QVERIFY(pointerEnteredSpy.wait()); @@ -199,7 +199,7 @@ auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(keyboardEnteredSpy.wait()); - QVERIFY(!client->geometry().contains(KWin::Cursor::pos())); + QVERIFY(!client->frameGeometry().contains(KWin::Cursor::pos())); Toplevel *selectedWindow = nullptr; auto callback = [&selectedWindow] (Toplevel *t) { @@ -223,16 +223,16 @@ kwinApp()->platform()->keyboardKeyPressed(key, timestamp++); kwinApp()->platform()->keyboardKeyReleased(key, timestamp++); }; - while (KWin::Cursor::pos().x() >= client->geometry().x() + client->geometry().width()) { + while (KWin::Cursor::pos().x() >= client->frameGeometry().x() + client->frameGeometry().width()) { keyPress(KEY_LEFT); } - while (KWin::Cursor::pos().x() <= client->geometry().x()) { + while (KWin::Cursor::pos().x() <= client->frameGeometry().x()) { keyPress(KEY_RIGHT); } - while (KWin::Cursor::pos().y() <= client->geometry().y()) { + while (KWin::Cursor::pos().y() <= client->frameGeometry().y()) { keyPress(KEY_DOWN); } - while (KWin::Cursor::pos().y() >= client->geometry().y() + client->geometry().height()) { + while (KWin::Cursor::pos().y() >= client->frameGeometry().y() + client->frameGeometry().height()) { keyPress(KEY_UP); } QFETCH(qint32, key); @@ -278,25 +278,25 @@ // simulate touch down quint32 timestamp = 0; - kwinApp()->platform()->touchDown(0, client->geometry().center(), timestamp++); + kwinApp()->platform()->touchDown(0, client->frameGeometry().center(), timestamp++); QVERIFY(!selectedWindow); kwinApp()->platform()->touchUp(0, timestamp++); QCOMPARE(input()->isSelectingWindow(), false); QCOMPARE(selectedWindow, client); // with movement selectedWindow = nullptr; kwinApp()->platform()->startInteractiveWindowSelection(callback); - kwinApp()->platform()->touchDown(0, client->geometry().bottomRight() + QPoint(20, 20), timestamp++); + kwinApp()->platform()->touchDown(0, client->frameGeometry().bottomRight() + QPoint(20, 20), timestamp++); QVERIFY(!selectedWindow); - kwinApp()->platform()->touchMotion(0, client->geometry().bottomRight() - QPoint(1, 1), timestamp++); + kwinApp()->platform()->touchMotion(0, client->frameGeometry().bottomRight() - QPoint(1, 1), timestamp++); QVERIFY(!selectedWindow); kwinApp()->platform()->touchUp(0, timestamp++); QCOMPARE(selectedWindow, client); QCOMPARE(input()->isSelectingWindow(), false); // it cancels active touch sequence on the window - kwinApp()->platform()->touchDown(0, client->geometry().center(), timestamp++); + kwinApp()->platform()->touchDown(0, client->frameGeometry().center(), timestamp++); QVERIFY(touchStartedSpy.wait()); selectedWindow = nullptr; kwinApp()->platform()->startInteractiveWindowSelection(callback); @@ -306,7 +306,7 @@ // this touch up does not yet select the window, it was started prior to the selection kwinApp()->platform()->touchUp(0, timestamp++); QVERIFY(!selectedWindow); - kwinApp()->platform()->touchDown(0, client->geometry().center(), timestamp++); + kwinApp()->platform()->touchDown(0, client->frameGeometry().center(), timestamp++); kwinApp()->platform()->touchUp(0, timestamp++); QCOMPARE(selectedWindow, client); QCOMPARE(input()->isSelectingWindow(), false); @@ -334,7 +334,7 @@ auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(keyboardEnteredSpy.wait()); - KWin::Cursor::setPos(client->geometry().center()); + KWin::Cursor::setPos(client->frameGeometry().center()); QCOMPARE(input()->pointer()->focus().data(), client); QVERIFY(pointerEnteredSpy.wait()); @@ -393,7 +393,7 @@ auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(keyboardEnteredSpy.wait()); - KWin::Cursor::setPos(client->geometry().center()); + KWin::Cursor::setPos(client->frameGeometry().center()); QCOMPARE(input()->pointer()->focus().data(), client); QVERIFY(pointerEnteredSpy.wait()); @@ -452,7 +452,7 @@ auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(keyboardEnteredSpy.wait()); - KWin::Cursor::setPos(client->geometry().center()); + KWin::Cursor::setPos(client->frameGeometry().center()); QCOMPARE(input()->pointer()->focus().data(), client); QVERIFY(pointerEnteredSpy.wait()); diff --git a/autotests/integration/xdgshellclient_rules_test.cpp b/autotests/integration/xdgshellclient_rules_test.cpp --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -1603,12 +1603,12 @@ QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); // Any attempt to change the maximized state should not succeed. - const QRect oldGeometry = client->geometry(); + const QRect oldGeometry = client->frameGeometry(); workspace()->slotWindowMaximize(); QVERIFY(!configureRequestedSpy->wait(100)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); - QCOMPARE(client->geometry(), oldGeometry); + QCOMPARE(client->frameGeometry(), oldGeometry); // If we create the client again, the maximized state should still be forced. shellSurface.reset(); @@ -1742,12 +1742,12 @@ QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); // The rule should be discarded after it's been applied. - const QRect oldGeometry = client->geometry(); + const QRect oldGeometry = client->frameGeometry(); client->evaluateWindowRules(); QVERIFY(!configureRequestedSpy->wait(100)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); - QCOMPARE(client->geometry(), oldGeometry); + QCOMPARE(client->frameGeometry(), oldGeometry); // Destroy the client. shellSurface.reset(); @@ -1812,12 +1812,12 @@ QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); // Any attempt to change the maximized state should not succeed. - const QRect oldGeometry = client->geometry(); + const QRect oldGeometry = client->frameGeometry(); workspace()->slotWindowMaximize(); QVERIFY(!configureRequestedSpy->wait(100)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); - QCOMPARE(client->geometry(), oldGeometry); + QCOMPARE(client->frameGeometry(), oldGeometry); // The rule should be discarded if we close the client. shellSurface.reset(); diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -308,7 +308,7 @@ QScopedPointer transientShellSurface(Test::createXdgShellStablePopup(transientSurface.data(), shellSurface.data(), positioner)); auto transient = Test::renderAndWaitForShown(transientSurface.data(), positioner.initialSize(), Qt::blue); QVERIFY(transient); - QCOMPARE(transient->geometry(), QRect(c->geometry().topLeft() + QPoint(5, 10), QSize(50, 40))); + QCOMPARE(transient->frameGeometry(), QRect(c->frameGeometry().topLeft() + QPoint(5, 10), QSize(50, 40))); // unmap the transient QSignalSpy windowHiddenSpy(transient, &XdgShellClient::windowHidden); @@ -318,14 +318,14 @@ QVERIFY(windowHiddenSpy.wait()); // now move the parent surface - c->setGeometry(c->geometry().translated(5, 10)); + c->setFrameGeometry(c->frameGeometry().translated(5, 10)); // now map the transient again QSignalSpy windowShownSpy(transient, &XdgShellClient::windowShown); QVERIFY(windowShownSpy.isValid()); Test::render(transientSurface.data(), QSize(50, 40), Qt::blue); QVERIFY(windowShownSpy.wait()); - QCOMPARE(transient->geometry(), QRect(c->geometry().topLeft() + QPoint(5, 10), QSize(50, 40))); + QCOMPARE(transient->frameGeometry(), QRect(c->frameGeometry().topLeft() + QPoint(5, 10), QSize(50, 40))); } void TestXdgShellClient::testWindowOutputs_data() @@ -348,7 +348,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), size, Qt::blue); //move to be in the first screen - c->setGeometry(QRect(QPoint(100,100), size)); + c->setFrameGeometry(QRect(QPoint(100,100), size)); //we don't don't know where the compositor first placed this window, //this might fire, it might not outputEnteredSpy.wait(5); @@ -358,15 +358,15 @@ QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(0,0)); //move to overlapping both first and second screen - c->setGeometry(QRect(QPoint(1250,100), size)); + c->setFrameGeometry(QRect(QPoint(1250,100), size)); QVERIFY(outputEnteredSpy.wait()); QCOMPARE(outputEnteredSpy.count(), 1); QCOMPARE(outputLeftSpy.count(), 0); QCOMPARE(surface->outputs().count(), 2); QVERIFY(surface->outputs()[0] != surface->outputs()[1]); //move entirely into second screen - c->setGeometry(QRect(QPoint(1400,100), size)); + c->setFrameGeometry(QRect(QPoint(1400,100), size)); QVERIFY(outputLeftSpy.wait()); QCOMPARE(outputEnteredSpy.count(), 1); QCOMPARE(outputLeftSpy.count(), 1); @@ -451,7 +451,7 @@ QVERIFY(!c->isFullScreen()); QCOMPARE(c->clientSize(), QSize(100, 50)); QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); - QCOMPARE(c->sizeForClientSize(c->clientSize()), c->geometry().size()); + QCOMPARE(c->sizeForClientSize(c->clientSize()), c->frameGeometry().size()); QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged); @@ -477,7 +477,7 @@ QCOMPARE(geometryChangedSpy.count(), 1); QVERIFY(c->isFullScreen()); QVERIFY(!c->isDecorated()); - QCOMPARE(c->geometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.first().first().toSize())); + QCOMPARE(c->frameGeometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.first().first().toSize())); QCOMPARE(c->layer(), ActiveLayer); // swap back to normal @@ -550,7 +550,7 @@ QVERIFY(geometryChangedSpy.wait()); QCOMPARE(geometryChangedSpy.count(), 1); QVERIFY(!c->isFullScreen()); - QCOMPARE(c->geometry().size(), QSize(100, 50)); + QCOMPARE(c->frameGeometry().size(), QSize(100, 50)); } void TestXdgShellClient::testUserCanSetFullscreen_data() @@ -708,7 +708,7 @@ QVERIFY(c->isFullScreen()); QVERIFY(!c->isDecorated()); - QCOMPARE(c->geometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.last().first().toSize())); + QCOMPARE(c->frameGeometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.last().first().toSize())); sizeChangeRequestedSpy.clear(); // swap back to normal @@ -1287,7 +1287,7 @@ QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged); // resize to 300,200 in kwin terms - c->setGeometry(QRect(100, 100, 300, 200)); + c->setFrameGeometry(QRect(100, 100, 300, 200)); QVERIFY(configureRequestedSpy.wait()); // requested geometry should not include the margins we had above const QSize requestedSize = configureRequestedSpy.last()[0].value(); @@ -1297,7 +1297,7 @@ geometryChangedSpy.wait(); // kwin's concept of geometry should remain the same - QCOMPARE(c->geometry(), QRect(100, 100, 300, 200)); + QCOMPARE(c->frameGeometry(), QRect(100, 100, 300, 200)); c->setFullScreen(true); configureRequestedSpy.wait(); diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -186,15 +186,15 @@ QVERIFY(client->surface()); // move pointer into the window, should trigger an enter - QVERIFY(!client->geometry().contains(Cursor::pos())); + QVERIFY(!client->frameGeometry().contains(Cursor::pos())); QVERIFY(enteredSpy.isEmpty()); - Cursor::setPos(client->geometry().center()); + Cursor::setPos(client->frameGeometry().center()); QCOMPARE(waylandServer()->seat()->focusedPointerSurface(), client->surface()); QVERIFY(waylandServer()->seat()->focusedPointer()); QVERIFY(enteredSpy.wait()); // move out of window - Cursor::setPos(client->geometry().bottomRight() + QPoint(10, 10)); + Cursor::setPos(client->frameGeometry().bottomRight() + QPoint(10, 10)); QVERIFY(leftSpy.wait()); // destroy window again diff --git a/autotests/mock_abstract_client.h b/autotests/mock_abstract_client.h --- a/autotests/mock_abstract_client.h +++ b/autotests/mock_abstract_client.h @@ -38,14 +38,14 @@ bool isActive() const; bool isFullScreen() const; bool isHiddenInternal() const; - QRect geometry() const; + QRect frameGeometry() const; bool keepBelow() const; void setActive(bool active); void setScreen(int screen); void setFullScreen(bool set); void setHiddenInternal(bool set); - void setGeometry(const QRect &rect); + void setFrameGeometry(const QRect &rect); void setKeepBelow(bool); bool isResize() const; void setResize(bool set); @@ -61,7 +61,7 @@ bool m_fullscreen; bool m_hiddenInternal; bool m_keepBelow; - QRect m_geometry; + QRect m_frameGeometry; bool m_resize; }; diff --git a/autotests/mock_abstract_client.cpp b/autotests/mock_abstract_client.cpp --- a/autotests/mock_abstract_client.cpp +++ b/autotests/mock_abstract_client.cpp @@ -29,7 +29,7 @@ , m_fullscreen(false) , m_hiddenInternal(false) , m_keepBelow(false) - , m_geometry() + , m_frameGeometry() , m_resize(false) { } @@ -82,15 +82,15 @@ m_hiddenInternal = set; } -void AbstractClient::setGeometry(const QRect &rect) +void AbstractClient::setFrameGeometry(const QRect &rect) { - m_geometry = rect; + m_frameGeometry = rect; emit geometryChanged(); } -QRect AbstractClient::geometry() const +QRect AbstractClient::frameGeometry() const { - return m_geometry; + return m_frameGeometry; } bool AbstractClient::keepBelow() const diff --git a/autotests/test_screen_edges.cpp b/autotests/test_screen_edges.cpp --- a/autotests/test_screen_edges.cpp +++ b/autotests/test_screen_edges.cpp @@ -706,7 +706,7 @@ QVERIFY(spy.isEmpty()); QCOMPARE(Cursor::pos(), QPoint(1, 50)); - client.setGeometry(screens()->geometry()); + client.setFrameGeometry(screens()->geometry()); client.setActive(true); client.setFullScreen(true); ws.setActiveClient(&client); @@ -739,7 +739,7 @@ // let's make the client fullscreen again, but with a geometry not intersecting the left edge QTest::qWait(351); client.setFullScreen(true); - client.setGeometry(client.geometry().translated(10, 0)); + client.setFrameGeometry(client.frameGeometry().translated(10, 0)); emit s->checkBlocking(); spy.clear(); Cursor::setPos(0, 50); @@ -750,7 +750,7 @@ QCOMPARE(Cursor::pos(), QPoint(1, 50)); // just to be sure, let's set geometry back - client.setGeometry(screens()->geometry()); + client.setFrameGeometry(screens()->geometry()); emit s->checkBlocking(); Cursor::setPos(0, 50); QVERIFY(isEntered(&event)); @@ -782,7 +782,7 @@ { using namespace KWin; X11Client client(workspace()); - client.setGeometry(QRect(10, 50, 10, 50)); + client.setFrameGeometry(QRect(10, 50, 10, 50)); auto s = ScreenEdges::self(); s->init(); @@ -796,7 +796,7 @@ //remove old reserves and resize to be in the middle of the screen s->reserve(&client, KWin::ElectricNone); - client.setGeometry(QRect(2, 2, 20, 20)); + client.setFrameGeometry(QRect(2, 2, 20, 20)); // for none of the edges it should be able to be set for (int i = 0; i < ELECTRIC_COUNT; ++i) { @@ -806,7 +806,7 @@ } // now let's try to set it and activate it - client.setGeometry(screens()->geometry()); + client.setFrameGeometry(screens()->geometry()); client.setHiddenInternal(true); s->reserve(&client, KWin::ElectricLeft); QCOMPARE(client.isHiddenInternal(), true); @@ -877,7 +877,7 @@ QCOMPARE(Cursor::pos(), QPoint(50, 0)); // set to windows can cover - client.setGeometry(screens()->geometry()); + client.setFrameGeometry(screens()->geometry()); client.setHiddenInternal(false); client.setKeepBelow(true); s->reserve(&client, KWin::ElectricLeft); diff --git a/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -1261,7 +1261,7 @@ if (const auto *cl = qobject_cast(t)) { return Workspace::self()->clientArea(opt, cl); } else { - return Workspace::self()->clientArea(opt, t->geometry().center(), VirtualDesktopManager::self()->current()); + return Workspace::self()->clientArea(opt, t->frameGeometry().center(), VirtualDesktopManager::self()->current()); } } @@ -1820,7 +1820,7 @@ TOPLEVEL_HELPER(QPoint, pos, pos) TOPLEVEL_HELPER(QSize, size, size) TOPLEVEL_HELPER(int, screen, screen) -TOPLEVEL_HELPER(QRect, geometry, geometry) +TOPLEVEL_HELPER(QRect, geometry, frameGeometry) TOPLEVEL_HELPER(QRect, expandedGeometry, visibleRect) TOPLEVEL_HELPER(QRect, rect, rect) TOPLEVEL_HELPER(int, desktop, desktop) diff --git a/events.cpp b/events.cpp --- a/events.cpp +++ b/events.cpp @@ -972,8 +972,8 @@ return true; } if (w == inputId()) { - x = x_root - geometry().x(); - y = y_root - geometry().y(); + x = x_root - frameGeometry().x(); + y = y_root - frameGeometry().y(); // New API processes core events FIRST and only passes unused ones to the decoration QMouseEvent ev(QMouseEvent::MouseButtonPress, QPoint(x, y), QPoint(x_root, y_root), x11ToQtMouseButton(button), x11ToQtMouseButtons(state), Qt::KeyboardModifiers()); @@ -1075,8 +1075,8 @@ return true; // care only about the whole frame if (!isMoveResizePointerButtonDown()) { if (w == inputId()) { - int x = x_root - geometry().x();// + padding_left; - int y = y_root - geometry().y();// + padding_top; + int x = x_root - frameGeometry().x();// + padding_left; + int y = y_root - frameGeometry().y();// + padding_top; if (isDecorated()) { QHoverEvent event(QEvent::HoverMove, QPointF(x, y), QPointF(x, y)); @@ -1202,12 +1202,12 @@ updateCursor(); } else if (direction == NET::KeyboardMove) { // ignore mouse coordinates given in the message, mouse position is used by the moving algorithm - Cursor::setPos(geometry().center()); - performMouseCommand(Options::MouseUnrestrictedMove, geometry().center()); + Cursor::setPos(frameGeometry().center()); + performMouseCommand(Options::MouseUnrestrictedMove, frameGeometry().center()); } else if (direction == NET::KeyboardSize) { // ignore mouse coordinates given in the message, mouse position is used by the resizing algorithm - Cursor::setPos(geometry().bottomRight()); - performMouseCommand(Options::MouseUnrestrictedResize, geometry().bottomRight()); + Cursor::setPos(frameGeometry().bottomRight()); + performMouseCommand(Options::MouseUnrestrictedResize, frameGeometry().bottomRight()); } } @@ -1281,8 +1281,8 @@ if (eventType == Xcb::Extensions::self()->shapeNotifyEvent()) { detectShape(window()); addRepaintFull(); - addWorkspaceRepaint(geometry()); // in case shape change removes part of this window - emit geometryShapeChanged(this, geometry()); + addWorkspaceRepaint(frameGeometry()); // in case shape change removes part of this window + emit geometryShapeChanged(this, frameGeometry()); } if (eventType == Xcb::Extensions::self()->damageNotifyEvent()) damageNotifyEvent(); diff --git a/geometry.cpp b/geometry.cpp --- a/geometry.cpp +++ b/geometry.cpp @@ -208,26 +208,26 @@ } auto margins = [c] (const QRect &geometry) { QMargins margins; - if (!geometry.intersects(c->geometry())) { + if (!geometry.intersects(c->frameGeometry())) { return margins; } // figure out which areas of the overall screen setup it borders - const bool left = c->geometry().left() == geometry.left(); - const bool right = c->geometry().right() == geometry.right(); - const bool top = c->geometry().top() == geometry.top(); - const bool bottom = c->geometry().bottom() == geometry.bottom(); - const bool horizontal = c->geometry().width() >= c->geometry().height(); + const bool left = c->frameGeometry().left() == geometry.left(); + const bool right = c->frameGeometry().right() == geometry.right(); + const bool top = c->frameGeometry().top() == geometry.top(); + const bool bottom = c->frameGeometry().bottom() == geometry.bottom(); + const bool horizontal = c->frameGeometry().width() >= c->frameGeometry().height(); if (left && ((!top && !bottom) || !horizontal)) { - margins.setLeft(c->geometry().width()); + margins.setLeft(c->frameGeometry().width()); } if (right && ((!top && !bottom) || !horizontal)) { - margins.setRight(c->geometry().width()); + margins.setRight(c->frameGeometry().width()); } if (top && ((!left && !right) || horizontal)) { - margins.setTop(c->geometry().height()); + margins.setTop(c->frameGeometry().height()); } if (bottom && ((!left && !right) || horizontal)) { - margins.setBottom(c->geometry().height()); + margins.setBottom(c->frameGeometry().height()); } return margins; }; @@ -247,7 +247,7 @@ return StrutAreaInvalid; }; const auto strut = margins(KWin::screens()->geometry(c->screen())); - const StrutRects strutRegion = StrutRects{StrutRect(c->geometry(), marginsToStrutArea(strut))}; + const StrutRects strutRegion = StrutRects{StrutRect(c->frameGeometry(), marginsToStrutArea(strut))}; QRect r = desktopArea - margins(KWin::screens()->geometry()); if (c->isOnAllDesktops()) { for (int i = 1; i <= numberOfDesktops; ++i) { @@ -397,7 +397,7 @@ QRect Workspace::clientArea(clientAreaOption opt, const AbstractClient* c) const { - return clientArea(opt, c->geometry().center(), c->desktop()); + return clientArea(opt, c->frameGeometry().center(), c->desktop()); } QRegion Workspace::restrictedMoveArea(int desktop, StrutAreas areas) const @@ -458,7 +458,7 @@ int guideMaximized = MaximizeRestore; if (c->maximizeMode() != MaximizeRestore) { maxRect = clientArea(MaximizeArea, pos + c->rect().center(), c->desktop()); - QRect geo = c->geometry(); + QRect geo = c->frameGeometry(); if (c->maximizeMode() & MaximizeHorizontal && (geo.x() == maxRect.left() || geo.right() == maxRect.right())) { guideMaximized |= MaximizeHorizontal; borderSnapZone.setWidth(qMax(borderSnapZone.width() + 2, maxRect.width() / 16)); @@ -497,7 +497,7 @@ const int snapX = borderSnapZone.width() * snapAdjust; //snap trigger const int snapY = borderSnapZone.height() * snapAdjust; if (snapX || snapY) { - QRect geo = c->geometry(); + QRect geo = c->frameGeometry(); QMargins frameMargins = c->frameMargins(); // snap to titlebar / snap to window borders on inner screen edges @@ -1095,17 +1095,17 @@ enum { Left = 0, Top, Right, Bottom }; const int border[4] = { borderLeft(), borderTop(), borderRight(), borderBottom() }; if( !oldGeometry.isValid()) - oldGeometry = geometry(); + oldGeometry = frameGeometry(); if( oldDesktop == -2 ) oldDesktop = desktop(); if (!oldClientGeometry.isValid()) oldClientGeometry = oldGeometry.adjusted(border[Left], border[Top], -border[Right], -border[Bottom]); if (isDesktop()) return; if (isFullScreen()) { QRect area = workspace()->clientArea(FullScreenArea, this); - if (geometry() != area) - setGeometry(area); + if (frameGeometry() != area) + setFrameGeometry(area); return; } if (isDock()) @@ -1115,14 +1115,14 @@ // TODO update geom_restore? changeMaximize(false, false, true); // adjust size const QRect screenArea = workspace()->clientArea(ScreenArea, this); - QRect geom = geometry(); + QRect geom = frameGeometry(); checkOffscreenPosition(&geom, screenArea); - setGeometry(geom); + setFrameGeometry(geom); return; } if (quickTileMode() != QuickTileMode(QuickTileFlag::None)) { - setGeometry(electricBorderMaximizeGeometry(geometry().center(), desktop())); + setFrameGeometry(electricBorderMaximizeGeometry(frameGeometry().center(), desktop())); return; } @@ -1302,8 +1302,8 @@ if (!isShade()) newGeom.setSize(adjustedSize(newGeom.size())); - if (newGeom != geometry()) - setGeometry(newGeom); + if (newGeom != frameGeometry()) + setFrameGeometry(newGeom); } void AbstractClient::checkOffscreenPosition(QRect* geom, const QRect& screenArea) @@ -1736,7 +1736,7 @@ GeometryUpdatesBlocker blocker(this); move(new_pos); plainResize(ns); - setGeometry(QRect(calculateGravitation(false, gravity), size())); + setFrameGeometry(QRect(calculateGravitation(false, gravity), size())); QRect area = workspace()->clientArea(WorkArea, this); if (!from_tool && (!isSpecialWindow() || isToolbar()) && !isFullScreen() && area.contains(origClientGeometry)) @@ -1777,7 +1777,7 @@ } } } - geom_restore = geometry(); + geom_restore = frameGeometry(); // No need to send synthetic configure notify event here, either it's sent together // with geometry change, or there's no need to send it. // Handling of the real ConfigureRequest event forces sending it, as there it's necessary. @@ -1841,7 +1841,7 @@ newy = newy + height() - h; break; } - setGeometry(newx, newy, w, h, force); + setFrameGeometry(newx, newy, w, h, force); } // _NET_MOVERESIZE_WINDOW @@ -1924,7 +1924,7 @@ /** * Reimplemented to inform the client about the new window position. */ -void X11Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) +void X11Client::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force) { // this code is also duplicated in X11Client::plainResize() // Ok, the shading geometry stuff. Generally, code doesn't care about shaded geometry, @@ -2121,9 +2121,9 @@ if (--m_blockGeometryUpdates == 0) { if (m_pendingGeometryUpdate != PendingGeometryNone) { if (isShade()) - setGeometry(QRect(pos(), adjustedSize()), NormalGeometrySet); + setFrameGeometry(QRect(pos(), adjustedSize()), NormalGeometrySet); else - setGeometry(geometry(), NormalGeometrySet); + setFrameGeometry(frameGeometry(), NormalGeometrySet); m_pendingGeometryUpdate = PendingGeometryNone; } } @@ -2275,14 +2275,14 @@ plainResize(adjustedSize(QSize(width() * 2 / 3, clientArea.height()), SizemodeFixedH), geom_mode); Placement::self()->placeSmart(this, clientArea); } else { - setGeometry(QRect(QPoint(geom_restore.x(), clientArea.top()), - adjustedSize(QSize(geom_restore.width(), clientArea.height()), SizemodeFixedH)), geom_mode); + setFrameGeometry(QRect(QPoint(geom_restore.x(), clientArea.top()), + adjustedSize(QSize(geom_restore.width(), clientArea.height()), SizemodeFixedH)), geom_mode); } } else { QRect r(x(), clientArea.top(), width(), clientArea.height()); r.setTopLeft(rules()->checkPosition(r.topLeft())); r.setSize(adjustedSize(r.size(), SizemodeFixedH)); - setGeometry(r, geom_mode); + setFrameGeometry(r, geom_mode); } info->setState(NET::MaxVert, NET::Max); break; @@ -2295,21 +2295,21 @@ plainResize(adjustedSize(QSize(clientArea.width(), height() * 2 / 3), SizemodeFixedW), geom_mode); Placement::self()->placeSmart(this, clientArea); } else { - setGeometry(QRect(QPoint(clientArea.left(), geom_restore.y()), - adjustedSize(QSize(clientArea.width(), geom_restore.height()), SizemodeFixedW)), geom_mode); + setFrameGeometry(QRect(QPoint(clientArea.left(), geom_restore.y()), + adjustedSize(QSize(clientArea.width(), geom_restore.height()), SizemodeFixedW)), geom_mode); } } else { QRect r(clientArea.left(), y(), clientArea.width(), height()); r.setTopLeft(rules()->checkPosition(r.topLeft())); r.setSize(adjustedSize(r.size(), SizemodeFixedW)); - setGeometry(r, geom_mode); + setFrameGeometry(r, geom_mode); } info->setState(NET::MaxHoriz, NET::Max); break; } case MaximizeRestore: { - QRect restore = geometry(); + QRect restore = frameGeometry(); // when only partially maximized, geom_restore may not have the other dimension remembered if (old_mode & MaximizeVertical) { restore.setTop(geom_restore.top()); @@ -2327,7 +2327,7 @@ s.setHeight(geom_restore.height()); plainResize(adjustedSize(s)); Placement::self()->placeSmart(this, clientArea); - restore = geometry(); + restore = frameGeometry(); if (geom_restore.width() > 0) restore.moveLeft(geom_restore.x()); if (geom_restore.height() > 0) @@ -2337,7 +2337,7 @@ if (m_geometryHints.hasAspect()) { restore.setSize(adjustedSize(restore.size(), SizemodeAny)); } - setGeometry(restore, geom_mode); + setFrameGeometry(restore, geom_mode); if (!clientArea.contains(geom_restore.center())) // Not restoring to the same screen Placement::self()->place(this, clientArea); info->setState(NET::States(), NET::Max); @@ -2387,7 +2387,7 @@ } r.moveTopLeft(rules()->checkPosition(r.topLeft())); } - setGeometry(r, geom_mode); + setFrameGeometry(r, geom_mode); if (options->electricBorderMaximize() && r.top() == clientArea.top()) updateQuickTileMode(QuickTileFlag::Maximize); else @@ -2429,7 +2429,7 @@ if (wasFullscreen) { workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event } else { - geom_fs_restore = geometry(); + geom_fs_restore = frameGeometry(); } if (set) { @@ -2450,14 +2450,14 @@ if (set) { if (info->fullscreenMonitors().isSet()) { - setGeometry(fullscreenMonitorsArea(info->fullscreenMonitors())); + setFrameGeometry(fullscreenMonitorsArea(info->fullscreenMonitors())); } else { - setGeometry(workspace()->clientArea(FullScreenArea, this)); + setFrameGeometry(workspace()->clientArea(FullScreenArea, this)); } } else { Q_ASSERT(!geom_fs_restore.isNull()); const int currentScreen = screen(); - setGeometry(QRect(geom_fs_restore.topLeft(), adjustedSize(geom_fs_restore.size()))); + setFrameGeometry(QRect(geom_fs_restore.topLeft(), adjustedSize(geom_fs_restore.size()))); if(currentScreen != screen()) { workspace()->sendClientToScreen(this, currentScreen); } @@ -2487,7 +2487,7 @@ info->setFullscreenMonitors(topology); if (isFullScreen()) - setGeometry(fullscreenMonitorsArea(topology)); + setFrameGeometry(fullscreenMonitorsArea(topology)); } /** @@ -2556,15 +2556,15 @@ const Position mode = moveResizePointerMode(); if (mode != PositionCenter) { // means "isResize()" but moveResizeMode = true is set below if (maximizeMode() == MaximizeFull) { // partial is cond. reset in finishMoveResize - setGeometryRestore(geometry()); // "restore" to current geometry + setGeometryRestore(frameGeometry()); // "restore" to current geometry setMaximize(false, false); } } if (quickTileMode() != QuickTileMode(QuickTileFlag::None) && mode != PositionCenter) { // Cannot use isResize() yet // Exit quick tile mode when the user attempts to resize a tiled window updateQuickTileMode(QuickTileFlag::None); // Do so without restoring original geometry - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); emit quickTileModeChanged(); } @@ -2612,7 +2612,7 @@ leaveMoveResize(); if (cancel) - setGeometry(initialMoveResizeGeometry()); + setFrameGeometry(initialMoveResizeGeometry()); else { const QRect &moveResizeGeom = moveResizeGeometry(); if (wasResize) { @@ -2624,7 +2624,7 @@ changeMaximize(restoreV, restoreH, false); } } - setGeometry(moveResizeGeom); + setFrameGeometry(moveResizeGeom); } checkScreen(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment if (screen() != moveResizeStartScreen()) { @@ -2639,12 +2639,12 @@ } else if (!cancel) { QRect geom_restore = geometryRestore(); if (!(maximizeMode() & MaximizeHorizontal)) { - geom_restore.setX(geometry().x()); - geom_restore.setWidth(geometry().width()); + geom_restore.setX(frameGeometry().x()); + geom_restore.setWidth(frameGeometry().width()); } if (!(maximizeMode() & MaximizeVertical)) { - geom_restore.setY(geometry().y()); - geom_restore.setHeight(geometry().height()); + geom_restore.setY(frameGeometry().y()); + geom_restore.setHeight(frameGeometry().height()); } setGeometryRestore(geom_restore); } @@ -2752,10 +2752,10 @@ void AbstractClient::handleMoveResize(const QPoint &local, const QPoint &global) { - const QRect oldGeo = geometry(); + const QRect oldGeo = frameGeometry(); handleMoveResize(local.x(), local.y(), global.x(), global.y()); if (!isFullScreen() && isMove()) { - if (quickTileMode() != QuickTileMode(QuickTileFlag::None) && oldGeo != geometry()) { + if (quickTileMode() != QuickTileMode(QuickTileFlag::None) && oldGeo != frameGeometry()) { GeometryUpdatesBlocker blocker(this); setQuickTileMode(QuickTileFlag::None); const QRect &geom_restore = geometryRestore(); @@ -3118,7 +3118,7 @@ { const QRect &moveResizeGeom = moveResizeGeometry(); if (isMove() || (isResize() && !haveResizeEffect())) { - setGeometry(moveResizeGeom); + setFrameGeometry(moveResizeGeom); } doPerformMoveResize(); if (isResize()) @@ -3198,10 +3198,10 @@ m_quickTileMode = int(QuickTileFlag::Maximize); setMaximize(true, true); QRect clientArea = workspace()->clientArea(MaximizeArea, this); - if (geometry().top() != clientArea.top()) { - QRect r(geometry()); + if (frameGeometry().top() != clientArea.top()) { + QRect r(frameGeometry()); r.moveTop(clientArea.top()); - setGeometry(r); + setFrameGeometry(r); } setGeometryRestore(prev_geom_restore); } @@ -3227,7 +3227,7 @@ setMaximize(false, false); - setGeometry(electricBorderMaximizeGeometry(keyboard ? geometry().center() : Cursor::pos(), desktop()), geom_mode); + setFrameGeometry(electricBorderMaximizeGeometry(keyboard ? frameGeometry().center() : Cursor::pos(), desktop()), geom_mode); // Store the mode change m_quickTileMode = mode; } else { @@ -3241,7 +3241,7 @@ } if (mode != QuickTileMode(QuickTileFlag::None)) { - QPoint whichScreen = keyboard ? geometry().center() : Cursor::pos(); + QPoint whichScreen = keyboard ? frameGeometry().center() : Cursor::pos(); // If trying to tile to the side that the window is already tiled to move the window to the next // screen if it exists, otherwise toggle the mode (set QuickTileFlag::None) @@ -3276,7 +3276,7 @@ mode = QuickTileFlag::None; // No other screens, toggle tiling } else { // Move to other screen - setGeometry(geometryRestore().translated(screens[nextScreen].topLeft() - screens[curScreen].topLeft())); + setFrameGeometry(geometryRestore().translated(screens[nextScreen].topLeft() - screens[curScreen].topLeft())); whichScreen = screens[nextScreen].center(); // Swap sides @@ -3288,16 +3288,16 @@ } else if (quickTileMode() == QuickTileMode(QuickTileFlag::None)) { // Not coming out of an existing tile, not shifting monitors, we're setting a brand new tile. // Store geometry first, so we can go out of this tile later. - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); } if (mode != QuickTileMode(QuickTileFlag::None)) { m_quickTileMode = mode; // decorations may turn off some borders when tiled const ForceGeometry_t geom_mode = isDecorated() ? ForceGeometrySet : NormalGeometrySet; // Temporary, so the maximize code doesn't get all confused m_quickTileMode = int(QuickTileFlag::None); - setGeometry(electricBorderMaximizeGeometry(whichScreen, desktop()), geom_mode); + setFrameGeometry(electricBorderMaximizeGeometry(whichScreen, desktop()), geom_mode); } // Store the mode change @@ -3308,10 +3308,10 @@ m_quickTileMode = int(QuickTileFlag::None); // Untiling, so just restore geometry, and we're done. if (!geometryRestore().isValid()) // invalid if we started maximized and wait for placement - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); // decorations may turn off some borders when tiled const ForceGeometry_t geom_mode = isDecorated() ? ForceGeometrySet : NormalGeometrySet; - setGeometry(geometryRestore(), geom_mode); + setFrameGeometry(geometryRestore(), geom_mode); checkWorkspacePosition(); // Just in case it's a different screen } emit quickTileModeChanged(); @@ -3352,16 +3352,16 @@ if (qtMode != QuickTileMode(QuickTileFlag::None)) keepInArea(oldScreenArea); - QRect oldGeom = geometry(); + QRect oldGeom = frameGeometry(); QRect newGeom = oldGeom; // move the window to have the same relative position to the center of the screen // (i.e. one near the middle of the right edge will also end up near the middle of the right edge) QPoint center = newGeom.center() - oldScreenArea.center(); center.setX(center.x() * screenArea.width() / oldScreenArea.width()); center.setY(center.y() * screenArea.height() / oldScreenArea.height()); center += screenArea.center(); newGeom.moveCenter(center); - setGeometry(newGeom); + setFrameGeometry(newGeom); // If the window was inside the old screen area, explicitly make sure its inside also the new screen area. // Calling checkWorkspacePosition() should ensure that, but when moving to a small screen the window could @@ -3372,12 +3372,12 @@ } // align geom_restore - checkWorkspacePosition operates on it - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); checkWorkspacePosition(oldGeom); // re-align geom_restore to constrained geometry - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); // finally reset special states // NOTICE that MaximizeRestore/QuickTileFlag::None checks are required. diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -2114,7 +2114,7 @@ } const UnmanagedList &unmanaged = Workspace::self()->unmanagedList(); foreach (Unmanaged *u, unmanaged) { - if (u->geometry().contains(pos) && acceptsInput(u, pos)) { + if (u->inputGeometry().contains(pos) && acceptsInput(u, pos)) { return u; } } @@ -2407,7 +2407,7 @@ if (!w || !w->isVisible()) { continue; } - if (!(*it)->geometry().contains(pos)) { + if (!(*it)->frameGeometry().contains(pos)) { continue; } // check input mask diff --git a/internal_client.h b/internal_client.h --- a/internal_client.h +++ b/internal_client.h @@ -74,8 +74,8 @@ void hideClient(bool hide) override; using AbstractClient::resizeWithChecks; void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; - using AbstractClient::setGeometry; - void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; + using AbstractClient::setFrameGeometry; + void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; void setGeometryRestore(const QRect &rect) override; bool supportsWindowRules() const override; AbstractClient *findModal(bool allow_itself = false) override; diff --git a/internal_client.cpp b/internal_client.cpp --- a/internal_client.cpp +++ b/internal_client.cpp @@ -68,8 +68,8 @@ blockGeometryUpdates(true); commitGeometry(m_internalWindow->geometry()); updateDecoration(true); - setGeometry(mapFromClient(m_internalWindow->geometry())); - setGeometryRestore(geometry()); + setFrameGeometry(mapFromClient(m_internalWindow->geometry())); + setGeometryRestore(frameGeometry()); blockGeometryUpdates(false); m_internalWindow->installEventFilter(this); @@ -323,10 +323,10 @@ if (h > area.height()) { h = area.height(); } - setGeometry(QRect(x(), y(), w, h)); + setFrameGeometry(QRect(x(), y(), w, h)); } -void InternalClient::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) +void InternalClient::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force) { const QRect rect(x, y, w, h); @@ -416,7 +416,7 @@ return; } - const QRect oldFrameGeometry = geometry(); + const QRect oldFrameGeometry = frameGeometry(); const QRect oldClientGeometry = oldFrameGeometry - frameMargins(); GeometryUpdatesBlocker blocker(this); @@ -537,9 +537,9 @@ return; } - const QRect clientGeometry = mapToClient(geometry()); + const QRect clientGeometry = mapToClient(frameGeometry()); AbstractClient::destroyDecoration(); - setGeometry(clientGeometry); + setFrameGeometry(clientGeometry); } void InternalClient::doMove(int x, int y) @@ -591,19 +591,19 @@ connect(decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { GeometryUpdatesBlocker blocker(this); - const QRect oldGeometry = geometry(); + const QRect oldGeometry = frameGeometry(); if (!isShade()) { checkWorkspacePosition(oldGeometry); } emit geometryShapeChanged(this, oldGeometry); } ); } - const QRect oldFrameGeometry = geometry(); + const QRect oldFrameGeometry = frameGeometry(); setDecoration(decoration); - setGeometry(mapFromClient(rect)); + setFrameGeometry(mapFromClient(rect)); emit geometryShapeChanged(this, oldFrameGeometry); } @@ -623,7 +623,7 @@ geom = rect; - m_clientSize = mapToClient(geometry()).size(); + m_clientSize = mapToClient(frameGeometry()).size(); addWorkspaceRepaint(visibleRect()); syncGeometryToInternalWindow(); @@ -663,11 +663,11 @@ void InternalClient::syncGeometryToInternalWindow() { - if (m_internalWindow->geometry() == mapToClient(geometry())) { + if (m_internalWindow->geometry() == mapToClient(frameGeometry())) { return; } - QTimer::singleShot(0, this, [this] { requestGeometry(geometry()); }); + QTimer::singleShot(0, this, [this] { requestGeometry(frameGeometry()); }); } void InternalClient::updateInternalWindowGeometry() diff --git a/layers.cpp b/layers.cpp --- a/layers.cpp +++ b/layers.cpp @@ -800,13 +800,13 @@ } else if (detail == XCB_STACK_MODE_TOP_IF) { other = workspace()->findClient(Predicate::WindowMatch, above); - if (other && other->geometry().intersects(geometry())) + if (other && other->frameGeometry().intersects(frameGeometry())) workspace()->raiseClientRequest(this, src, timestamp); return; } else if (detail == XCB_STACK_MODE_BOTTOM_IF) { other = workspace()->findClient(Predicate::WindowMatch, above); - if (other && other->geometry().intersects(geometry())) + if (other && other->frameGeometry().intersects(frameGeometry())) workspace()->lowerClientRequest(this, src, timestamp); return; } diff --git a/manage.cpp b/manage.cpp --- a/manage.cpp +++ b/manage.cpp @@ -376,7 +376,7 @@ // TODO: get KMainWindow a correct state storage what will allow to store the restore size as well. if (!session) { // has a better handling of this - geom_restore = geometry(); // Remember restore geometry + geom_restore = frameGeometry(); // Remember restore geometry if (isMaximizable() && (width() >= area.width() || height() >= area.height())) { // Window is too large for the screen, maximize in the // directions necessary diff --git a/placement.cpp b/placement.cpp --- a/placement.cpp +++ b/placement.cpp @@ -105,7 +105,7 @@ if (options->borderSnapZone()) { // snap to titlebar / snap to window borders on inner screen edges - const QRect geo(c->geometry()); + const QRect geo(c->frameGeometry()); QPoint corner = geo.topLeft(); const QMargins frameMargins = c->frameMargins(); AbstractClient::Position titlePos = c->titlebarPosition(); @@ -377,7 +377,7 @@ QPoint Workspace::cascadeOffset(const AbstractClient *c) const { - QRect area = clientArea(PlacementArea, c->geometry().center(), c->desktop()); + QRect area = clientArea(PlacementArea, c->frameGeometry().center(), c->desktop()); return QPoint(area.width()/48, area.height()/48); } @@ -516,16 +516,16 @@ const auto parent = c->transientFor(); const QRect screen = Workspace::self()->clientArea(parent->isFullScreen() ? FullScreenArea : PlacementArea, parent); const QRect popupGeometry = c->transientPlacement(screen); - c->setGeometry(popupGeometry); + c->setFrameGeometry(popupGeometry); // Potentially a client could set no constraint adjustments // and we'll be offscreen. // The spec implies we should place window the offscreen. However, // practically Qt doesn't set any constraint adjustments yet so we can't. // Also kwin generally doesn't let clients do what they want - if (!screen.contains(c->geometry())) { + if (!screen.contains(c->frameGeometry())) { c->keepInArea(screen); } } @@ -539,7 +539,7 @@ { Q_ASSERT(area.isValid()); - QRect geom = c->geometry(); + QRect geom = c->frameGeometry(); geom.moveCenter(Cursor::pos()); c->move(geom.topLeft()); c->keepInArea(area); // make sure it's kept inside workarea @@ -591,8 +591,8 @@ place(c, area, Centered); return; } - QRect geom = c->geometry(); - geom.moveCenter(place_on->geometry().center()); + QRect geom = c->frameGeometry(); + geom.moveCenter(place_on->frameGeometry().center()); c->move(geom.topLeft()); // get area again, because the mainwindow may be on different xinerama screen const QRect placementArea = workspace()->clientArea(PlacementArea, c); @@ -610,7 +610,7 @@ c->maximize(MaximizeFull); else { // if the geometry doesn't match default maximize area (xinerama case?), // it's probably better to use the given area - c->setGeometry(area); + c->setFrameGeometry(area); } } else { c->resizeWithChecks(c->maxSize().boundedTo(area.size())); @@ -714,29 +714,29 @@ void Workspace::slotWindowPackLeft() { if (active_client && active_client->isMovable()) - active_client->packTo(packPositionLeft(active_client, active_client->geometry().left(), true), + active_client->packTo(packPositionLeft(active_client, active_client->frameGeometry().left(), true), active_client->y()); } void Workspace::slotWindowPackRight() { if (active_client && active_client->isMovable()) - active_client->packTo(packPositionRight(active_client, active_client->geometry().right(), true) + active_client->packTo(packPositionRight(active_client, active_client->frameGeometry().right(), true) - active_client->width() + 1, active_client->y()); } void Workspace::slotWindowPackUp() { if (active_client && active_client->isMovable()) active_client->packTo(active_client->x(), - packPositionUp(active_client, active_client->geometry().top(), true)); + packPositionUp(active_client, active_client->frameGeometry().top(), true)); } void Workspace::slotWindowPackDown() { if (active_client && active_client->isMovable()) active_client->packTo(active_client->x(), - packPositionDown(active_client, active_client->geometry().bottom(), true) - active_client->height() + 1); + packPositionDown(active_client, active_client->frameGeometry().bottom(), true) - active_client->height() + 1); } void Workspace::slotWindowGrowHorizontal() @@ -749,21 +749,21 @@ { if (!isResizable() || isShade()) return; - QRect geom = geometry(); + QRect geom = frameGeometry(); geom.setRight(workspace()->packPositionRight(this, geom.right(), true)); QSize adjsize = adjustedSize(geom.size(), SizemodeFixedW); - if (geometry().size() == adjsize && geom.size() != adjsize && resizeIncrements().width() > 1) { // take care of size increments + if (frameGeometry().size() == adjsize && geom.size() != adjsize && resizeIncrements().width() > 1) { // take care of size increments int newright = workspace()->packPositionRight(this, geom.right() + resizeIncrements().width() - 1, true); // check that it hasn't grown outside of the area, due to size increments // TODO this may be wrong? if (workspace()->clientArea(MovementArea, - QPoint((x() + newright) / 2, geometry().center().y()), desktop()).right() >= newright) + QPoint((x() + newright) / 2, frameGeometry().center().y()), desktop()).right() >= newright) geom.setRight(newright); } geom.setSize(adjustedSize(geom.size(), SizemodeFixedW)); geom.setSize(adjustedSize(geom.size(), SizemodeFixedH)); workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event; - setGeometry(geom); + setFrameGeometry(geom); } void Workspace::slotWindowShrinkHorizontal() @@ -776,14 +776,14 @@ { if (!isResizable() || isShade()) return; - QRect geom = geometry(); + QRect geom = frameGeometry(); geom.setRight(workspace()->packPositionLeft(this, geom.right(), false)); if (geom.width() <= 1) return; geom.setSize(adjustedSize(geom.size(), SizemodeFixedW)); if (geom.width() > 20) { workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event; - setGeometry(geom); + setFrameGeometry(geom); } } @@ -797,19 +797,19 @@ { if (!isResizable() || isShade()) return; - QRect geom = geometry(); + QRect geom = frameGeometry(); geom.setBottom(workspace()->packPositionDown(this, geom.bottom(), true)); QSize adjsize = adjustedSize(geom.size(), SizemodeFixedH); - if (geometry().size() == adjsize && geom.size() != adjsize && resizeIncrements().height() > 1) { // take care of size increments + if (frameGeometry().size() == adjsize && geom.size() != adjsize && resizeIncrements().height() > 1) { // take care of size increments int newbottom = workspace()->packPositionDown(this, geom.bottom() + resizeIncrements().height() - 1, true); // check that it hasn't grown outside of the area, due to size increments if (workspace()->clientArea(MovementArea, - QPoint(geometry().center().x(), (y() + newbottom) / 2), desktop()).bottom() >= newbottom) + QPoint(frameGeometry().center().x(), (y() + newbottom) / 2), desktop()).bottom() >= newbottom) geom.setBottom(newbottom); } geom.setSize(adjustedSize(geom.size(), SizemodeFixedH)); workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event; - setGeometry(geom); + setFrameGeometry(geom); } @@ -823,14 +823,14 @@ { if (!isResizable() || isShade()) return; - QRect geom = geometry(); + QRect geom = frameGeometry(); geom.setBottom(workspace()->packPositionUp(this, geom.bottom(), false)); if (geom.height() <= 1) return; geom.setSize(adjustedSize(geom.size(), SizemodeFixedH)); if (geom.height() > 20) { workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event; - setGeometry(geom); + setFrameGeometry(geom); } } @@ -848,9 +848,9 @@ int newx = clientArea(MaximizeArea, cl).left(); if (oldx <= newx) // try another Xinerama screen newx = clientArea(MaximizeArea, - QPoint(cl->geometry().left() - 1, cl->geometry().center().y()), cl->desktop()).left(); + QPoint(cl->frameGeometry().left() - 1, cl->frameGeometry().center().y()), cl->desktop()).left(); if (cl->titlebarPosition() != AbstractClient::PositionLeft) { - QRect geo = cl->geometry(); + QRect geo = cl->frameGeometry(); int rgt = newx - cl->clientPos().x(); geo.moveRight(rgt); if (screens()->intersecting(geo) < 2) @@ -862,10 +862,10 @@ for (auto it = m_allClients.constBegin(), end = m_allClients.constEnd(); it != end; ++it) { if (isIrrelevant(*it, cl, desktop)) continue; - int x = left_edge ? (*it)->geometry().right() + 1 : (*it)->geometry().left() - 1; + int x = left_edge ? (*it)->frameGeometry().right() + 1 : (*it)->frameGeometry().left() - 1; if (x > newx && x < oldx - && !(cl->geometry().top() > (*it)->geometry().bottom() // they overlap in Y direction - || cl->geometry().bottom() < (*it)->geometry().top())) + && !(cl->frameGeometry().top() > (*it)->frameGeometry().bottom() // they overlap in Y direction + || cl->frameGeometry().bottom() < (*it)->frameGeometry().top())) newx = x; } return newx; @@ -876,9 +876,9 @@ int newx = clientArea(MaximizeArea, cl).right(); if (oldx >= newx) // try another Xinerama screen newx = clientArea(MaximizeArea, - QPoint(cl->geometry().right() + 1, cl->geometry().center().y()), cl->desktop()).right(); + QPoint(cl->frameGeometry().right() + 1, cl->frameGeometry().center().y()), cl->desktop()).right(); if (cl->titlebarPosition() != AbstractClient::PositionRight) { - QRect geo = cl->geometry(); + QRect geo = cl->frameGeometry(); int rgt = newx + cl->width() - (cl->clientSize().width() + cl->clientPos().x()); geo.moveRight(rgt); if (screens()->intersecting(geo) < 2) @@ -890,10 +890,10 @@ for (auto it = m_allClients.constBegin(), end = m_allClients.constEnd(); it != end; ++it) { if (isIrrelevant(*it, cl, desktop)) continue; - int x = right_edge ? (*it)->geometry().left() - 1 : (*it)->geometry().right() + 1; + int x = right_edge ? (*it)->frameGeometry().left() - 1 : (*it)->frameGeometry().right() + 1; if (x < newx && x > oldx - && !(cl->geometry().top() > (*it)->geometry().bottom() - || cl->geometry().bottom() < (*it)->geometry().top())) + && !(cl->frameGeometry().top() > (*it)->frameGeometry().bottom() + || cl->frameGeometry().bottom() < (*it)->frameGeometry().top())) newx = x; } return newx; @@ -904,9 +904,9 @@ int newy = clientArea(MaximizeArea, cl).top(); if (oldy <= newy) // try another Xinerama screen newy = clientArea(MaximizeArea, - QPoint(cl->geometry().center().x(), cl->geometry().top() - 1), cl->desktop()).top(); + QPoint(cl->frameGeometry().center().x(), cl->frameGeometry().top() - 1), cl->desktop()).top(); if (cl->titlebarPosition() != AbstractClient::PositionTop) { - QRect geo = cl->geometry(); + QRect geo = cl->frameGeometry(); int top = newy - cl->clientPos().y(); geo.moveTop(top); if (screens()->intersecting(geo) < 2) @@ -918,10 +918,10 @@ for (auto it = m_allClients.constBegin(), end = m_allClients.constEnd(); it != end; ++it) { if (isIrrelevant(*it, cl, desktop)) continue; - int y = top_edge ? (*it)->geometry().bottom() + 1 : (*it)->geometry().top() - 1; + int y = top_edge ? (*it)->frameGeometry().bottom() + 1 : (*it)->frameGeometry().top() - 1; if (y > newy && y < oldy - && !(cl->geometry().left() > (*it)->geometry().right() // they overlap in X direction - || cl->geometry().right() < (*it)->geometry().left())) + && !(cl->frameGeometry().left() > (*it)->frameGeometry().right() // they overlap in X direction + || cl->frameGeometry().right() < (*it)->frameGeometry().left())) newy = y; } return newy; @@ -932,9 +932,9 @@ int newy = clientArea(MaximizeArea, cl).bottom(); if (oldy >= newy) // try another Xinerama screen newy = clientArea(MaximizeArea, - QPoint(cl->geometry().center().x(), cl->geometry().bottom() + 1), cl->desktop()).bottom(); + QPoint(cl->frameGeometry().center().x(), cl->frameGeometry().bottom() + 1), cl->desktop()).bottom(); if (cl->titlebarPosition() != AbstractClient::PositionBottom) { - QRect geo = cl->geometry(); + QRect geo = cl->frameGeometry(); int btm = newy + cl->height() - (cl->clientSize().height() + cl->clientPos().y()); geo.moveBottom(btm); if (screens()->intersecting(geo) < 2) @@ -946,10 +946,10 @@ for (auto it = m_allClients.constBegin(), end = m_allClients.constEnd(); it != end; ++it) { if (isIrrelevant(*it, cl, desktop)) continue; - int y = bottom_edge ? (*it)->geometry().top() - 1 : (*it)->geometry().bottom() + 1; + int y = bottom_edge ? (*it)->frameGeometry().top() - 1 : (*it)->frameGeometry().bottom() + 1; if (y < newy && y > oldy - && !(cl->geometry().left() > (*it)->geometry().right() - || cl->geometry().right() < (*it)->geometry().left())) + && !(cl->frameGeometry().left() > (*it)->frameGeometry().right() + || cl->frameGeometry().right() < (*it)->frameGeometry().left())) newy = y; } return newy; diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -2553,7 +2553,7 @@ QRect left, top, right, bottom; client()->client()->layoutDecorationRects(left, top, right, bottom); - const QRect geometry = dirty ? QRect(QPoint(0, 0), client()->client()->geometry().size()) : scheduled.boundingRect(); + const QRect geometry = dirty ? QRect(QPoint(0, 0), client()->client()->size()) : scheduled.boundingRect(); auto renderPart = [this](const QRect &geo, const QRect &partRect, const QPoint &offset, bool rotated = false) { if (!geo.isValid()) { diff --git a/plugins/scenes/qpainter/scene_qpainter.cpp b/plugins/scenes/qpainter/scene_qpainter.cpp --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -280,7 +280,7 @@ tempImage.fill(Qt::transparent); tempPainter.begin(&tempImage); tempPainter.save(); - tempPainter.translate(toplevel->geometry().topLeft() - toplevel->visibleRect().topLeft()); + tempPainter.translate(toplevel->frameGeometry().topLeft() - toplevel->visibleRect().topLeft()); painter = &tempPainter; } renderShadow(painter); @@ -313,7 +313,7 @@ tempPainter.fillRect(QRect(QPoint(0, 0), toplevel->visibleRect().size()), translucent); tempPainter.end(); painter = scenePainter; - painter->drawImage(toplevel->visibleRect().topLeft() - toplevel->geometry().topLeft(), tempImage); + painter->drawImage(toplevel->visibleRect().topLeft() - toplevel->frameGeometry().topLeft(), tempImage); } painter->restore(); diff --git a/rules.cpp b/rules.cpp --- a/rules.cpp +++ b/rules.cpp @@ -908,7 +908,7 @@ QRect orig_geom = QRect(pos(), sizeForClientSize(clientSize())); // handle shading QRect geom = client_rules->checkGeometry(orig_geom); if (geom != orig_geom) - setGeometry(geom); + setFrameGeometry(geom); // MinSize, MaxSize handled by Geometry // IgnoreGeometry setDesktop(desktop()); diff --git a/scene.h b/scene.h --- a/scene.h +++ b/scene.h @@ -566,7 +566,7 @@ inline QRect Scene::Window::geometry() const { - return toplevel->geometry(); + return toplevel->frameGeometry(); } inline diff --git a/screenedge.cpp b/screenedge.cpp --- a/screenedge.cpp +++ b/screenedge.cpp @@ -538,7 +538,7 @@ } bool newValue = false; if (AbstractClient *client = Workspace::self()->activeClient()) { - newValue = client->isFullScreen() && client->geometry().contains(m_geometry.center()); + newValue = client->isFullScreen() && client->frameGeometry().contains(m_geometry.center()); } if (newValue == m_blocked) { return; @@ -1262,7 +1262,7 @@ int x = 0; int width = 0; int height = 0; - const QRect geo = client->geometry(); + const QRect geo = client->frameGeometry(); const QRect fullArea = workspace()->clientArea(FullArea, 0, 1); for (int i = 0; i < screens()->count(); ++i) { const QRect screen = screens()->geometry(i); diff --git a/shadow.cpp b/shadow.cpp --- a/shadow.cpp +++ b/shadow.cpp @@ -38,7 +38,7 @@ Shadow::Shadow(Toplevel *toplevel) : m_topLevel(toplevel) - , m_cachedSize(toplevel->geometry().size()) + , m_cachedSize(toplevel->size()) , m_decorationShadow(nullptr) { connect(m_topLevel, SIGNAL(geometryChanged()), SLOT(geometryChanged())); @@ -373,10 +373,10 @@ } void Shadow::geometryChanged() { - if (m_cachedSize == m_topLevel->geometry().size()) { + if (m_cachedSize == m_topLevel->size()) { return; } - m_cachedSize = m_topLevel->geometry().size(); + m_cachedSize = m_topLevel->size(); updateShadowRegion(); buildQuads(); } diff --git a/toplevel.h b/toplevel.h --- a/toplevel.h +++ b/toplevel.h @@ -71,7 +71,21 @@ Q_PROPERTY(bool alpha READ hasAlpha NOTIFY hasAlphaChanged) Q_PROPERTY(qulonglong frameId READ frameId) - Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) + + /** + * This property holds the geometry of the Toplevel, excluding invisible + * portions, e.g. client-side and server-side drop-shadows, etc. + * + * @deprecated Use frameGeometry property instead. + */ + Q_PROPERTY(QRect geometry READ frameGeometry NOTIFY geometryChanged) + + /** + * This property holds the geometry of the Toplevel, excluding invisible + * portions, e.g. server-side and client-side drop-shadows, etc. + */ + Q_PROPERTY(QRect frameGeometry READ frameGeometry NOTIFY geometryChanged) + Q_PROPERTY(QRect visibleRect READ visibleRect) Q_PROPERTY(int height READ height) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) @@ -261,7 +275,11 @@ * @return a unique identifier for the Toplevel. On X11 same as @ref window */ virtual quint32 windowId() const; - QRect geometry() const; + /** + * Returns the geometry of the Toplevel, excluding invisible portions, e.g. + * server-side and client-side drop shadows, etc. + */ + QRect frameGeometry() const; /** * The geometry of the Toplevel which accepts input events. This might be larger * than the actual geometry, e.g. to support resizing outside the window. @@ -669,7 +687,7 @@ m_client.reset(w, false); } -inline QRect Toplevel::geometry() const +inline QRect Toplevel::frameGeometry() const { return geom; } diff --git a/toplevel.cpp b/toplevel.cpp --- a/toplevel.cpp +++ b/toplevel.cpp @@ -149,7 +149,7 @@ if (shadow() && !shadow()->shadowRegion().isEmpty()) { r |= shadow()->shadowRegion().boundingRect(); } - return r.translated(geometry().topLeft()); + return r.translated(frameGeometry().topLeft()); } Xcb::Property Toplevel::fetchWmClientLeader() const @@ -523,7 +523,7 @@ emit screenChanged(); } } else { - const int s = screens()->number(geometry().center()); + const int s = screens()->number(frameGeometry().center()); if (s != m_screen) { m_screen = s; emit screenChanged(); @@ -566,7 +566,7 @@ bool Toplevel::isOnScreen(int screen) const { - return screens()->geometry(screen).intersects(geometry()); + return screens()->geometry(screen).intersects(frameGeometry()); } bool Toplevel::isOnActiveScreen() const @@ -782,7 +782,7 @@ QRect Toplevel::inputGeometry() const { - return geometry(); + return frameGeometry(); } bool Toplevel::isLocalhost() const diff --git a/useractions.cpp b/useractions.cpp --- a/useractions.cpp +++ b/useractions.cpp @@ -1052,9 +1052,9 @@ if (!c) return; if (op == Options::MoveOp || op == Options::UnrestrictedMoveOp) - Cursor::setPos(c->geometry().center()); + Cursor::setPos(c->frameGeometry().center()); if (op == Options::ResizeOp || op == Options::UnrestrictedResizeOp) - Cursor::setPos(c->geometry().bottomRight()); + Cursor::setPos(c->frameGeometry().bottomRight()); switch(op) { case Options::MoveOp: c->performMouseCommand(Options::MouseMove, Cursor::pos()); @@ -1510,8 +1510,7 @@ int desktopNumber = c->isOnAllDesktops() ? VirtualDesktopManager::self()->current() : c->desktop(); // Centre of the active window - QPoint curPos(c->pos().x() + c->geometry().width() / 2, - c->pos().y() + c->geometry().height() / 2); + QPoint curPos(c->x() + c->width() / 2, c->y() + c->height() / 2); if (!switchWindow(c, direction, curPos, desktopNumber)) { auto opposite = [&] { @@ -1547,8 +1546,7 @@ if (client->wantsTabFocus() && *i != c && client->isOnDesktop(d) && !client->isMinimized() && (*i)->isOnCurrentActivity()) { // Centre of the other window - QPoint other(client->pos().x() + client->geometry().width() / 2, - client->pos().y() + client->geometry().height() / 2); + const QPoint other(client->x() + client->width() / 2, client->y() + client->height() / 2); int distance; int offset; @@ -1609,7 +1607,7 @@ void Workspace::showApplicationMenu(const QRect &pos, AbstractClient *c, int actionId) { - ApplicationMenu::self()->showApplicationMenu(c->geometry().topLeft() + pos.bottomLeft(), c, actionId); + ApplicationMenu::self()->showApplicationMenu(c->pos() + pos.bottomLeft(), c, actionId); } /** diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -1014,7 +1014,7 @@ client->isOnCurrentActivity() && client->isOnActiveScreen())) continue; - if (client->geometry().contains(Cursor::pos())) { + if (client->frameGeometry().contains(Cursor::pos())) { if (!client->isDesktop()) return client; break; // unconditional break - we do not pass the focus to some client below an unusable one diff --git a/x11client.h b/x11client.h --- a/x11client.h +++ b/x11client.h @@ -173,8 +173,8 @@ void updateShape(); - using AbstractClient::setGeometry; - void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; + using AbstractClient::setFrameGeometry; + void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; /// plainResize() simply resizes void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet); void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet); diff --git a/x11client.cpp b/x11client.cpp --- a/x11client.cpp +++ b/x11client.cpp @@ -352,7 +352,7 @@ input_offset = bounds.topLeft(); // Move the bounding rect to screen coordinates - bounds.translate(geometry().topLeft()); + bounds.translate(frameGeometry().topLeft()); // Move the region to input window coordinates region.translate(-input_offset); @@ -383,7 +383,7 @@ if (!force && ((!isDecorated() && noBorder()) || (isDecorated() && !noBorder()))) return; - QRect oldgeom = geometry(); + QRect oldgeom = frameGeometry(); QRect oldClientGeom = oldgeom.adjusted(borderLeft(), borderTop(), -borderRight(), -borderBottom()); blockGeometryUpdates(true); if (force) @@ -415,7 +415,7 @@ // calculateGravitation(true) would have to operate on the old border sizes // move(calculateGravitation(true)); // move(calculateGravitation(false)); - QRect oldgeom = geometry(); + QRect oldgeom = frameGeometry(); plainResize(sizeForClientSize(clientSize()), ForceGeometrySet); if (!isShade()) checkWorkspacePosition(oldgeom); @@ -437,7 +437,7 @@ void X11Client::destroyDecoration() { - QRect oldgeom = geometry(); + QRect oldgeom = frameGeometry(); if (isDecorated()) { QPoint grav = calculateGravitation(true); AbstractClient::destroyDecoration(); @@ -661,7 +661,7 @@ addRepaintFull(); addWorkspaceRepaint(visibleRect()); // In case shape change removes part of this window } - emit geometryShapeChanged(this, geometry()); + emit geometryShapeChanged(this, frameGeometry()); } static Xcb::Window shape_helper_window(XCB_WINDOW_NONE); @@ -855,7 +855,7 @@ QSize s(sizeForClientSize(clientSize())); shade_geometry_change = false; plainResize(s); - geom_restore = geometry(); + setGeometryRestore(frameGeometry()); if ((shade_mode == ShadeHover || shade_mode == ShadeActivated) && rules()->checkAcceptFocus(info->input())) setActive(true); if (shade_mode == ShadeHover) { diff --git a/xdgshellclient.h b/xdgshellclient.h --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -98,8 +98,8 @@ bool dockWantsInput() const override; using AbstractClient::resizeWithChecks; void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; - using AbstractClient::setGeometry; - void setGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; + using AbstractClient::setFrameGeometry; + void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override; bool hasStrut() const override; quint32 windowId() const override; pid_t pid() const override; diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -189,7 +189,7 @@ const QRect originalGeometry = QRect(pos(), sizeForClientSize(clientSize())); const QRect ruledGeometry = rules()->checkGeometry(originalGeometry, true); if (originalGeometry != ruledGeometry) { - setGeometry(ruledGeometry); + setFrameGeometry(ruledGeometry); } maximize(rules()->checkMaximize(maximizeMode(), true)); @@ -417,10 +417,11 @@ [this]() { GeometryUpdatesBlocker blocker(this); RequestGeometryBlocker requestBlocker(this); - QRect oldgeom = geometry(); - if (!isShade()) - checkWorkspacePosition(oldgeom); - emit geometryShapeChanged(this, oldgeom); + const QRect oldGeometry = frameGeometry(); + if (!isShade()) { + checkWorkspacePosition(oldGeometry); + } + emit geometryShapeChanged(this, oldGeometry); } ); } @@ -437,7 +438,7 @@ if (!force && ((!isDecorated() && noBorder()) || (isDecorated() && !noBorder()))) return; - QRect oldgeom = geometry(); + QRect oldgeom = frameGeometry(); QRect oldClientGeom = oldgeom.adjusted(borderLeft(), borderTop(), -borderRight(), -borderBottom()); blockGeometryUpdates(true); if (force) @@ -462,7 +463,7 @@ blockGeometryUpdates(false); } -void XdgShellClient::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) +void XdgShellClient::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force) { const QRect newGeometry = rules()->checkGeometry(QRect(x, y, w, h)); @@ -715,7 +716,7 @@ workspace()->clientArea(MaximizeArea, this); const MaximizeMode oldMode = m_requestedMaximizeMode; - const QRect oldGeometry = geometry(); + const QRect oldGeometry = frameGeometry(); // 'adjust == true' means to update the size only, e.g. after changing workspace size if (!adjust) { @@ -783,7 +784,7 @@ if (quickTileMode() != oldQuickTileMode) { emit quickTileModeChanged(); } - setGeometry(workspace()->clientArea(MaximizeArea, this)); + setFrameGeometry(workspace()->clientArea(MaximizeArea, this)); workspace()->raiseClient(this); } else { if (m_requestedMaximizeMode == MaximizeRestore) { @@ -794,9 +795,9 @@ } if (m_geomMaximizeRestore.isValid()) { - setGeometry(m_geomMaximizeRestore); + setFrameGeometry(m_geomMaximizeRestore); } else { - setGeometry(workspace()->clientArea(PlacementArea, this)); + setFrameGeometry(workspace()->clientArea(PlacementArea, this)); } } } @@ -860,7 +861,7 @@ if (wasFullscreen) { workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event } else { - m_geomFsRestore = geometry(); + m_geomFsRestore = frameGeometry(); } m_fullScreen = set; @@ -875,17 +876,17 @@ updateDecoration(false, false); if (set) { - setGeometry(workspace()->clientArea(FullScreenArea, this)); + setFrameGeometry(workspace()->clientArea(FullScreenArea, this)); } else { if (m_geomFsRestore.isValid()) { int currentScreen = screen(); - setGeometry(QRect(m_geomFsRestore.topLeft(), adjustedSize(m_geomFsRestore.size()))); + setFrameGeometry(QRect(m_geomFsRestore.topLeft(), adjustedSize(m_geomFsRestore.size()))); if( currentScreen != screen()) workspace()->sendClientToScreen( this, currentScreen ); } else { // this can happen when the window was first shown already fullscreen, // so let the client set the size by itself - setGeometry(QRect(workspace()->clientArea(PlacementArea, this).topLeft(), QSize(0, 0))); + setFrameGeometry(QRect(workspace()->clientArea(PlacementArea, this).topLeft(), QSize(0, 0))); } } @@ -1031,7 +1032,7 @@ if (m_xdgShellPopup) { auto parent = transientFor(); if (parent) { - const QPoint globalClientContentPos = parent->geometry().topLeft() + parent->clientPos(); + const QPoint globalClientContentPos = parent->frameGeometry().topLeft() + parent->clientPos(); const QPoint relativeOffset = rect.topLeft() - globalClientContentPos; serialId = m_xdgShellPopup->configure(QRect(relativeOffset, size)); } @@ -1059,7 +1060,7 @@ } if (it->serialId == m_lastAckedConfigureRequest) { if (position != it->positionAfterResize) { - addLayerRepaint(geometry()); + addLayerRepaint(frameGeometry()); } position = it->positionAfterResize; maximizeMode = it->maximizeMode; @@ -1270,7 +1271,7 @@ if (h > area.height()) { h = area.height(); } - setGeometry(x(), y(), w, h, force); + setFrameGeometry(x(), y(), w, h, force); } void XdgShellClient::unmap() @@ -1379,7 +1380,7 @@ if ((m_plasmaShellSurface->panelBehavior() == PlasmaShellSurfaceInterface::PanelBehavior::AutoHide && m_hidden) || m_plasmaShellSurface->panelBehavior() == PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover) { // screen edge API requires an edge, thus we need to figure out which edge the window borders - const QRect clientGeometry = geometry(); + const QRect clientGeometry = frameGeometry(); Qt::Edges edges; for (int i = 0; i < screens()->count(); i++) { const QRect screenGeometry = screens()->geometry(i); @@ -1548,7 +1549,7 @@ Qt::Edges gravity; QPoint offset; PositionerConstraints constraintAdjustments; - QSize size = geometry().size(); + QSize size = frameGeometry().size(); const QPoint parentClientPos = transientFor()->pos() + transientFor()->clientPos(); QRect popupPosition; @@ -1821,7 +1822,7 @@ void XdgShellClient::placeIn(const QRect &area) { Placement::self()->place(this, area); - setGeometryRestore(geometry()); + setGeometryRestore(frameGeometry()); } void XdgShellClient::showOnScreenEdge() @@ -1884,7 +1885,7 @@ const auto outputs = waylandServer()->display()->outputs(); for (OutputInterface* output: qAsConst(outputs)) { const QRect outputGeom(output->globalPosition(), output->pixelSize() / output->scale()); - if (geometry().intersects(outputGeom)) { + if (frameGeometry().intersects(outputGeom)) { clientOutputs << output; } }