summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2022-11-02 13:15:27 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-08 14:27:35 +0000
commitcd66a6ca3a40265c4a1bbef613f4f6dd252d66c4 (patch)
tree91bca42aefdcf930b03d07e08441d423200b70f0
parentb93ffe81e868fa46a3921310e8f7eae2e74bc261 (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.cpp2
-rw-r--r--tests/auto/client/seatv4/tst_seatv4.cpp11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 89bbc7615..ba4cc068c 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -263,7 +263,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 b92c3dbea..389d5fdb4 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 QVector<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()