From b93ffe81e868fa46a3921310e8f7eae2e74bc261 Mon Sep 17 00:00:00 2001 From: Tarja Sundqvist Date: Thu, 6 Oct 2022 17:49:19 +0300 Subject: Bump version to 5.15.12 Change-Id: I6df356a60125b998358a71302dbd9fdc8aa07476 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 365b998ab..ea2250975 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ DEFINES += QT_NO_FOREACH DEFINES += QT_NO_JAVA_STYLE_ITERATORS DEFINES += QT_NO_LINKED_LIST -MODULE_VERSION = 5.15.11 +MODULE_VERSION = 5.15.12 -- cgit v1.2.3 From cd66a6ca3a40265c4a1bbef613f4f6dd252d66c4 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 2 Nov 2022 13:15:27 +0100 Subject: 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 Reviewed-by: David Edmundson Reviewed-by: Qt CI Bot (cherry picked from commit 8b1f37cc801420157e94ce459fe22605f8cc486e) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandinputdevice.cpp | 2 +- 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 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 &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() -- cgit v1.2.3 From 4f3490008c1fb90f4c6a21d1908c69f5548eb972 Mon Sep 17 00:00:00 2001 From: Janne Juntunen Date: Wed, 11 May 2022 13:49:46 +0300 Subject: client: Mark return values as unused to suppress compiler warnings Return values of two write() functions were ignored, causing warnings which were treated as errors on webOS emulator build. Fixes: QTBUG-103378 Change-Id: Ifc2e944dee376973b69220b7f75dc346c0a71e71 Reviewed-by: David Edmundson (cherry picked from commit 6f1bacdd10562ffb1eed51ea3bb8993df3e23896) Reviewed-by: Janne Juntunen --- src/client/qwaylanddatasource.cpp | 3 ++- src/client/qwaylandprimaryselectionv1.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index a5d3d3fcf..a0635de20 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -93,7 +93,8 @@ void QWaylandDataSource::data_source_send(const QString &mime_type, int32_t fd) action.sa_flags = 0; sigaction(SIGPIPE, &action, &oldAction); - write(fd, content.constData(), content.size()); + ssize_t unused = write(fd, content.constData(), content.size()); + Q_UNUSED(unused); sigaction(SIGPIPE, &oldAction, nullptr); } close(fd); diff --git a/src/client/qwaylandprimaryselectionv1.cpp b/src/client/qwaylandprimaryselectionv1.cpp index b8806a810..b9cbf84c6 100644 --- a/src/client/qwaylandprimaryselectionv1.cpp +++ b/src/client/qwaylandprimaryselectionv1.cpp @@ -160,7 +160,8 @@ void QWaylandPrimarySelectionSourceV1::zwp_primary_selection_source_v1_send(cons action.sa_flags = 0; sigaction(SIGPIPE, &action, &oldAction); - write(fd, content.constData(), size_t(content.size())); + ssize_t unused = write(fd, content.constData(), size_t(content.size())); + Q_UNUSED(unused); sigaction(SIGPIPE, &oldAction, nullptr); } close(fd); -- cgit v1.2.3 From 4cc3ce4a20fb46ed70094bd1c9a4c735eb37cc60 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Thu, 6 Oct 2022 19:46:56 +0200 Subject: Always use blocking write for data_source.send QtWaylandClient assumes that data_source's fd is BLOCKING, but some compositors (e.g. mutter) pass an fd with O_NONBLOCK set. In this case, 'write' is not guaranteed to process all of the passed data in one call. Instead of dealing with such partial writes, remove O_NONBLOCK. Fixes: QTBUG-107076 Change-Id: Ieb446da9fdfbaaa55100f573b396ee449cadc463 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 5025ac15088d1b85007b3d3439c14bdc3e4979a1) Reviewed-by: Liang Qi --- src/client/qwaylanddatasource.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index a0635de20..c71ce0fd2 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -49,6 +49,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -93,6 +94,13 @@ void QWaylandDataSource::data_source_send(const QString &mime_type, int32_t fd) action.sa_flags = 0; sigaction(SIGPIPE, &action, &oldAction); + // Some compositors (e.g., mutter) make fd with O_NONBLOCK. + // Since wl_data_source.send describes that fd is closed here, + // it should be done in a loop and don't have any advantage. + // Blocking operation will be used. + // According to fcntl(2), FSETFL ignores O_WRONLY. So this + // call will just remove O_NONBLOCK. + fcntl(fd, F_SETFL, O_WRONLY); ssize_t unused = write(fd, content.constData(), content.size()); Q_UNUSED(unused); sigaction(SIGPIPE, &oldAction, nullptr); -- cgit v1.2.3 From df401d596364fd6a90dc1527a85d97ff863deae1 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 22 Nov 2022 20:58:22 +0200 Subject: Client: Honor QGuiApplication::overrideCursor() If there's a QGuiApplication::overrideCursor(), QWindow::cursor() can still return a different cursor. This can result in a wrong cursor when the pointer enters a window. Fixes: QTBUG-75919 Change-Id: I015117b4b6d252b421ab14bd8f2a8f582f7cae52 Reviewed-by: Liang Qi (cherry picked from commit 471b2123400ef6936b5173553205549c7dd1a249) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 47f643f73..514768772 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -1053,7 +1053,10 @@ void QWaylandWindow::setMouseCursor(QWaylandInputDevice *device, const QCursor & void QWaylandWindow::restoreMouseCursor(QWaylandInputDevice *device) { - setMouseCursor(device, window()->cursor()); + if (const QCursor *overrideCursor = QGuiApplication::overrideCursor()) + setMouseCursor(device, *overrideCursor); + else + setMouseCursor(device, window()->cursor()); } #endif -- cgit v1.2.3