Commit 7d4471eb authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Rename geometry property to frameGeometry

Summary:
In order to properly implement xdg_surface.set_window_geometry we need
two kinds of geometry - frame and buffer. The frame geometry specifies
visible bounds of the client on the screen, excluding client-side drop
shadows. The buffer geometry specifies rectangle on the screen that the
attached buffer or x11 pixmap occupies on the screen.

This change renames the geometry property to frameGeometry in order to
reflect the new meaning assigned to it as well to make it easier to
differentiate between frame geometry and buffer geometry in the future.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24334
parent 45784b70
......@@ -87,11 +87,11 @@ AbstractClient::AbstractClient()
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 @@ void AbstractClient::keepInArea(QRect area, bool partial)
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 @@ void AbstractClient::setupWindowManagementInterface()
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 @@ void AbstractClient::setupWindowManagementInterface()
);
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 @@ bool AbstractClient::performMouseCommand(Options::MouseCommand cmd, const QPoint
AbstractClient *c = qobject_cast<AbstractClient*>(*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,7 +1308,7 @@ void AbstractClient::addRepaintDuringGeometryUpdates()
void AbstractClient::updateGeometryBeforeUpdateBlocking()
{
m_geometryBeforeUpdateBlocking = geometry();
m_geometryBeforeUpdateBlocking = frameGeometry();
}
void AbstractClient::doMove(int, int)
......@@ -1317,7 +1317,7 @@ 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 @@ void AbstractClient::setVirtualKeyboardGeometry(const QRect &geo)
{
// 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 @@ void AbstractClient::setVirtualKeyboardGeometry(const QRect &geo)
newWindowGeometry.moveBottom(geo.top());
newWindowGeometry.setTop(qMax(newWindowGeometry.top(), availableArea.top()));
setGeometry(newWindowGeometry);
setFrameGeometry(newWindowGeometry);
}
bool AbstractClient::dockWantsInput() const
......
......@@ -222,7 +222,7 @@ class KWIN_EXPORT AbstractClient : public Toplevel
* 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 @@ public:
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 @@ inline void AbstractClient::resizeWithChecks(const QSize& s, AbstractClient::For
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*>& AbstractClient::transients() const
......
......@@ -430,7 +430,7 @@ AbstractClient *Workspace::clientUnderMouse(int screen) const
client->isOnCurrentActivity() && client->isOnScreen(screen)))
continue;
if (client->geometry().contains(Cursor::pos())) {
if (client->frameGeometry().contains(Cursor::pos())) {
return client;
}
}
......
......@@ -201,7 +201,7 @@ void DecorationInputTest::testAxis()
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 @@ void KWin::DecorationInputTest::testDoubleClick()
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 @@ void KWin::DecorationInputTest::testDoubleTap()
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 @@ void DecorationInputTest::testHover()
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 @@ void DecorationInputTest::testHover()
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 @@ void DecorationInputTest::testPressToMove()
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 @@ void DecorationInputTest::testPressToMove()
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 @@ void DecorationInputTest::testTapToMove()
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 @@ void DecorationInputTest::testTapToMove()
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,8 +558,8 @@ void DecorationInputTest::testResizeOutsideWindow()
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());
......@@ -568,18 +568,18 @@ void DecorationInputTest::testResizeOutsideWindow()
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 @@ void DecorationInputTest::testModifierClickUnrestrictedMove()
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 @@ void DecorationInputTest::testModifierScrollOpacity()
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 @@ void DecorationInputTest::testTouchEvents()
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++);
......
......@@ -156,7 +156,7 @@ void X11DesktopWindowTest::testDesktopWindow()
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());
......
......@@ -135,7 +135,7 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows()
QSignalSpy maximizedStateChangedSpy(client, static_cast<void (AbstractClient::*)(KWin::AbstractClient*, MaximizeMode)>(&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());
......
......@@ -115,7 +115,7 @@ void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco()
// 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)
......
......@@ -104,8 +104,8 @@ void DontCrashEmptyDecorationTest::testBug361551()
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);
......
......@@ -137,7 +137,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
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 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
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);
......
......@@ -164,7 +164,7 @@ void TranslucencyTest::testMoveAfterDesktopChange()
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);
......
......@@ -150,7 +150,7 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
// 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);
......
......@@ -232,7 +232,7 @@ void InternalWindowTest::testEnterLeave()
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 @@ void InternalWindowTest::testMove()
QTRY_COMPARE(clientAddedSpy.count(), 1);
auto internalClient = clientAddedSpy.first().first().value<InternalClient *>();
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 @@ void InternalWindowTest::testModifierClickUnrestrictedMove()
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 @@ void InternalWindowTest::testModifierScroll()
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);
......
......@@ -239,7 +239,7 @@ void LockScreenTest::testPointer()
// first move cursor into the center of the window
quint32 timestamp = 1;
MOTION(c->geometry().center());
MOTION(c->frameGeometry().center());
QVERIFY(enteredSpy.wait());
LOCK
......@@ -248,24 +248,24 @@ void LockScreenTest::testPointer()
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 @@ void LockScreenTest::testPointerButton()
// 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 @@ void LockScreenTest::testPointerAxis()
// 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++);
......
......@@ -204,7 +204,7 @@ void TestMaximized::testInitiallyMaximized()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
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 @@ void TestMaximized::testBorderlessMaximizedWindow()
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 @@ void TestMaximized::testBorderlessMaximizedWindow()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
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 @@ void TestMaximized::testBorderlessMaximizedWindow()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
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);
......
......@@ -137,7 +137,7 @@ void MoveResizeWindowTest::testMove()
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,7 +188,7 @@ void MoveResizeWindowTest::testMove()
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
...