[plasma/kwin] /: Rename Window::cursor()
Vlad Zahorodnii <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 89fb173031ab8f914dfa8714fe777dd73782c60e by Vlad Zahorodnii.
Committed on 22/07/2026 at 07:28.
Pushed by vladz into branch 'master'.
Rename Window::cursor()
The new name better reflects what it is.
M +11 -11 autotests/integration/decoration_input_test.cpp
M +2 -2 src/events.cpp
M +2 -2 src/pointer_input.cpp
M +12 -12 src/window.cpp
M +2 -2 src/window.h
M +1 -1 src/xdgshellwindow.cpp
M +1 -1 src/xxpipv1window.cpp
https://invent.kde.org/plasma/kwin/-/commit/89fb173031ab8f914dfa8714fe777dd73782c60e
diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp
index 0eea28f0fac..94517bb4a49 100644
--- a/autotests/integration/decoration_input_test.cpp
+++ b/autotests/integration/decoration_input_test.cpp
@@ -308,7 +308,7 @@ void DecorationInputTest::testHover()
quint32 timestamp = 1;
MOTION(QPoint(window->frameGeometry().center().x(), window->frameMargins().top() / 2.0));
- QCOMPARE(window->cursor(), CursorShape(Qt::ArrowCursor));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(Qt::ArrowCursor));
// There is a mismatch of the cursor key positions between windows
// with and without borders (with borders one can move inside a bit and still
@@ -322,25 +322,25 @@ void DecorationInputTest::testHover()
};
MOTION(QPoint(window->frameGeometry().x(), 0));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthWest));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeNorthWest));
MOTION(QPoint(window->frameGeometry().x() + window->frameGeometry().width() / 2, 0));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorth));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeNorth));
MOTION(QPoint(window->frameGeometry().x() + window->frameGeometry().width() - 1, 0));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeNorthEast));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeNorthEast));
MOTION(QPoint(window->frameGeometry().x() + window->frameGeometry().width() + deviation(), window->height() / 2));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeEast));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeEast));
MOTION(QPoint(window->frameGeometry().x() + window->frameGeometry().width() + deviation(), window->height() - 1));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthEast));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeSouthEast));
MOTION(QPoint(window->frameGeometry().x() + window->frameGeometry().width() / 2, window->height() + deviation()));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouth));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeSouth));
MOTION(QPoint(window->frameGeometry().x(), window->height() + deviation()));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeSouthWest));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeSouthWest));
MOTION(QPoint(window->frameGeometry().x() - 1, window->height() / 2));
- QCOMPARE(window->cursor(), CursorShape(KWin::ExtendedCursor::SizeWest));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(KWin::ExtendedCursor::SizeWest));
MOTION(window->frameGeometry().center());
QEXPECT_FAIL("", "Cursor not set back on leave", Continue);
- QCOMPARE(window->cursor(), CursorShape(Qt::ArrowCursor));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(Qt::ArrowCursor));
}
void DecorationInputTest::testPressToMove_data()
@@ -367,7 +367,7 @@ void DecorationInputTest::testPressToMove()
quint32 timestamp = 1;
MOTION(QPoint(window->frameGeometry().center().x(), window->y() + window->frameMargins().top() / 2.0));
- QCOMPARE(window->cursor(), CursorShape(Qt::ArrowCursor));
+ QCOMPARE(window->interactiveMoveResizeCursor(), CursorShape(Qt::ArrowCursor));
PRESS;
QVERIFY(!window->isInteractiveMove());
diff --git a/src/events.cpp b/src/events.cpp
index a6a31a6032f..a6ec97f529f 100644
--- a/src/events.cpp
+++ b/src/events.cpp
@@ -620,7 +620,7 @@ void X11Window::NETMoveResize(qreal x_root, qreal y_root, NET::Direction directi
if (isInteractiveMoveResize() && direction == NET::MoveResizeCancel) {
finishInteractiveMoveResize(true);
setInteractiveMoveResizePointerButtonDown(false);
- updateCursor();
+ updateInteractiveMoveResizeCursor();
} else if (direction == NET::Move || (direction >= NET::TopLeft && direction <= NET::Left)) {
if (!button) {
if (!input()->qtButtonStates() && !input()->touch()->touchPointCount()) {
@@ -663,7 +663,7 @@ void X11Window::NETMoveResize(qreal x_root, qreal y_root, NET::Direction directi
if (!startInteractiveMoveResize()) {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
} else if (direction == NET::KeyboardMove) {
// ignore mouse coordinates given in the message, mouse position is used by the moving algorithm
diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp
index 90be8bf3e16..3ef668a772e 100644
--- a/src/pointer_input.cpp
+++ b/src/pointer_input.cpp
@@ -1100,7 +1100,7 @@ void CursorImage::updateDecorationCursor()
{
auto deco = m_pointer->decoration();
if (Window *window = deco ? deco->window() : nullptr) {
- m_decoration.cursor->setShape(window->cursor().name());
+ m_decoration.cursor->setShape(window->interactiveMoveResizeCursor().name());
}
reevaluteSource();
}
@@ -1108,7 +1108,7 @@ void CursorImage::updateDecorationCursor()
void CursorImage::updateMoveResize()
{
if (Window *window = workspace()->moveResizeWindow()) {
- m_moveResizeCursor->setShape(window->cursor().name());
+ m_moveResizeCursor->setShape(window->interactiveMoveResizeCursor().name());
}
reevaluteSource();
}
diff --git a/src/window.cpp b/src/window.cpp
index c4fc876a672..52814e6a50e 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1123,7 +1123,7 @@ void Window::startDelayedInteractiveMoveResize()
if (!startInteractiveMoveResize()) {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
stopDelayedInteractiveMoveResize();
});
m_interactiveMoveResize.delayedTimer->start(QApplication::startDragTime());
@@ -2149,7 +2149,7 @@ bool Window::performMousePressCommand(Options::MouseCommand cmd, const QPointF &
if (!startInteractiveMoveResize()) {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
break;
}
case Options::MouseActivateRaiseAndResize:
@@ -2189,7 +2189,7 @@ bool Window::performMousePressCommand(Options::MouseCommand cmd, const QPointF &
if (!startInteractiveMoveResize()) {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
break;
}
case Options::MouseNothing:
@@ -2388,7 +2388,7 @@ qreal Window::borderTop() const
return isDecorated() ? decoration()->borderTop() : 0;
}
-void Window::updateCursor()
+void Window::updateInteractiveMoveResizeCursor()
{
if (isDeleted()) {
return;
@@ -2577,12 +2577,12 @@ void Window::keyPressEvent(QKeyCombination key_combination)
case Qt::Key_Enter:
setInteractiveMoveResizePointerButtonDown(false);
finishInteractiveMoveResize(false);
- updateCursor();
+ updateInteractiveMoveResizeCursor();
break;
case Qt::Key_Escape:
setInteractiveMoveResizePointerButtonDown(false);
finishInteractiveMoveResize(true);
- updateCursor();
+ updateInteractiveMoveResizeCursor();
break;
default:
return;
@@ -2639,7 +2639,7 @@ void Window::endInteractiveMoveResize()
finishInteractiveMoveResize(false);
setInteractiveMoveResizeGravity(mouseGravity());
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
void Window::cancelInteractiveMoveResize()
@@ -2650,7 +2650,7 @@ void Window::cancelInteractiveMoveResize()
finishInteractiveMoveResize(true);
setInteractiveMoveResizeGravity(mouseGravity());
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
void Window::setDecoration(std::shared_ptr<KDecoration3::Decoration> decoration)
@@ -2760,7 +2760,7 @@ void Window::processDecorationMove(const QPointF &localPos, const QPointF &globa
} else {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
}
return;
@@ -2770,7 +2770,7 @@ void Window::processDecorationMove(const QPointF &localPos, const QPointF &globa
Gravity newGravity = mouseGravity();
if (newGravity != interactiveMoveResizeGravity()) {
setInteractiveMoveResizeGravity(newGravity);
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
}
@@ -2840,7 +2840,7 @@ bool Window::processDecorationButtonPress(const QPointF &localPos, const QPointF
setInteractiveMoveOffset(QPointF(qreal(localPos.x()) / width(), qreal(localPos.y()) / height()));
setUnrestrictedInteractiveMoveResize(false);
startDelayedInteractiveMoveResize();
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
// In the new API the decoration may process the menu action to display an inactive tab's menu.
// If the event is unhandled then the core will create one for the active window in the group.
@@ -2860,7 +2860,7 @@ void Window::processDecorationButtonRelease(Qt::MouseButton button)
finishInteractiveMoveResize(false);
setInteractiveMoveResizeGravity(mouseGravity());
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
}
diff --git a/src/window.h b/src/window.h
index 6184b9b3c6f..ea24507a4e0 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1172,7 +1172,7 @@ public:
/**
* Cursor shape for move/resize mode.
*/
- CursorShape cursor() const
+ CursorShape interactiveMoveResizeCursor() const
{
return m_interactiveMoveResize.cursor;
}
@@ -1704,7 +1704,7 @@ protected:
/**
* Sets an appropriate cursor shape for the logical mouse position.
*/
- void updateCursor();
+ void updateInteractiveMoveResizeCursor();
void startDelayedInteractiveMoveResize();
void stopDelayedInteractiveMoveResize();
bool startInteractiveMoveResize();
diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp
index 536eb758be0..c8e47ac9a27 100644
--- a/src/xdgshellwindow.cpp
+++ b/src/xdgshellwindow.cpp
@@ -1073,7 +1073,7 @@ void XdgToplevelWindow::handleResizeRequested(SeatInterface *seat, Gravity gravi
if (!startInteractiveMoveResize()) {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
void XdgToplevelWindow::handleStatesAcknowledged(const XdgToplevelInterface::States &states)
diff --git a/src/xxpipv1window.cpp b/src/xxpipv1window.cpp
index f80bf410356..f42e23da6d1 100644
--- a/src/xxpipv1window.cpp
+++ b/src/xxpipv1window.cpp
@@ -138,7 +138,7 @@ void XXPipV1Window::handleResizeRequested(SeatInterface *seat, Gravity gravity,
if (!startInteractiveMoveResize()) {
setInteractiveMoveResizePointerButtonDown(false);
}
- updateCursor();
+ updateInteractiveMoveResizeCursor();
}
void XXPipV1Window::doSetNextTargetScale()