diff options
author | Liang Qi <liang.qi@qt.io> | 2022-11-02 13:15:27 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-11-08 14:27:35 +0000 |
commit | 5a473d3706acac60b3021b90fe91fa909b8d4fd9 (patch) | |
tree | b14d8aeef3b24aad6a3a55ef0b1079a04fbb3411 | |
parent | 4cbe4ab6c3a72042a98e4de68bc50f19a95d610c (diff) |
tests: fix tst_seatv4 to use 24 as default cursor size
Also set default cursor size to 24 for client, which is correct
both on KDE and GNOME at least.
Fixes: QTBUG-104259
Change-Id: Ie4ba27695974025b093a86d8c96fb23d25ad23f7
Reviewed-by: Inho Lee <inho.lee@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 8b1f37cc801420157e94ce459fe22605f8cc486e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 2 | ||||
-rw-r--r-- | tests/auto/client/seatv4/tst_seatv4.cpp | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index e57a480d5..825eeb1f9 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -267,7 +267,7 @@ QString QWaylandInputDevice::Pointer::cursorThemeName() const int QWaylandInputDevice::Pointer::cursorSize() const { - constexpr int defaultCursorSize = 32; + constexpr int defaultCursorSize = 24; static const int xCursorSize = qEnvironmentVariableIntValue("XCURSOR_SIZE"); return xCursorSize > 0 ? xCursorSize : defaultCursorSize; } diff --git a/tests/auto/client/seatv4/tst_seatv4.cpp b/tests/auto/client/seatv4/tst_seatv4.cpp index 2f5d8f718..ac9a59a27 100644 --- a/tests/auto/client/seatv4/tst_seatv4.cpp +++ b/tests/auto/client/seatv4/tst_seatv4.cpp @@ -63,6 +63,7 @@ class tst_seatv4 : public QObject, private SeatV4Compositor { Q_OBJECT private slots: + void init(); void cleanup(); void bindsToSeat(); void keyboardKeyPress(); @@ -85,6 +86,12 @@ private slots: #endif }; +void tst_seatv4::init() +{ + // Remove the extra outputs to clean up for the next test + exec([&] { while (auto *o = output(1)) remove(o); }); +} + void tst_seatv4::cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); @@ -135,7 +142,7 @@ void tst_seatv4::setsCursorOnEnter() window.show(); QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); - exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); }); + exec([&] { pointer()->sendEnter(xdgSurface()->m_surface, {24, 24}); }); QCOMPOSITOR_TRY_VERIFY(cursorSurface()); } @@ -360,7 +367,7 @@ static bool supportsCursorSizes(const QList<uint> &sizes) static uint defaultCursorSize() { const int xCursorSize = qEnvironmentVariableIntValue("XCURSOR_SIZE"); - return xCursorSize > 0 ? uint(xCursorSize) : 32; + return xCursorSize > 0 ? uint(xCursorSize) : 24; } void tst_seatv4::scaledCursor() |