diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-10-11 16:02:42 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-10-11 16:02:42 +0300 |
commit | ec9fb19ead796d88bb9a67a4ddd269870cbacb54 (patch) | |
tree | 13d5aeef1522e72d3f78aab3d626402947a324f3 | |
parent | b8f1882df7215b6e00f66b7a6a08afafe230de29 (diff) | |
parent | df401d596364fd6a90dc1527a85d97ff863deae1 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.12' into tqtc/lts-5.15-opensourcev5.15.12-lts-lgpl
Change-Id: Id4cd89681f0caac55919949c7735ef8645390ccf
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/client/qwaylanddatasource.cpp | 11 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylandprimaryselectionv1.cpp | 3 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 5 | ||||
-rw-r--r-- | tests/auto/client/seatv4/tst_seatv4.cpp | 11 |
6 files changed, 27 insertions, 7 deletions
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 diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index 9b17cdfab..c2bc9dc45 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -49,6 +49,7 @@ #include <unistd.h> #include <signal.h> +#include <fcntl.h> QT_BEGIN_NAMESPACE @@ -93,7 +94,15 @@ 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()); + // 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); } close(fd); diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 08e8adb8f..b0e9692bd 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/src/client/qwaylandprimaryselectionv1.cpp b/src/client/qwaylandprimaryselectionv1.cpp index 78b1de133..7805dd734 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); diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 5a390434d..d57094a71 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 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() |