diff --git a/desktop/toolkit/qt5/qt5-3d/pspec.xml b/desktop/toolkit/qt5/qt5-3d/pspec.xml index fe53792f56..470eecb824 100755 --- a/desktop/toolkit/qt5/qt5-3d/pspec.xml +++ b/desktop/toolkit/qt5/qt5-3d/pspec.xml @@ -15,24 +15,24 @@ desktop C++ and QML APIs for easy inclusion of 3D graphics C++ and QML APIs for easy inclusion of 3D graphics - https://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qt3d-everywhere-opensource-src-5.15.9.tar.xz + https://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qt3d-everywhere-opensource-src-5.15.10.tar.xz - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel assimp-devel vulkan-headers zlib-devel - - + + qt5-3d C++ and QML APIs for easy inclusion of 3D graphics - qt5-base - qt5-declarative + qt5-base + qt5-declarative libgcc assimp @@ -48,8 +48,8 @@ qt5-3d-devel Development files for qt5-3d - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt5-3d @@ -60,6 +60,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9 diff --git a/desktop/toolkit/qt5/qt5-accountsservice/pspec.xml b/desktop/toolkit/qt5/qt5-accountsservice/pspec.xml index 55d1afa3b2..6964520c50 100755 --- a/desktop/toolkit/qt5/qt5-accountsservice/pspec.xml +++ b/desktop/toolkit/qt5/qt5-accountsservice/pspec.xml @@ -15,8 +15,8 @@ liri-cmake-shared extra-cmake-modules - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel @@ -24,8 +24,8 @@ qt5-accountsservice libgcc - qt5-base - qt5-declarative + qt5-base + qt5-declarative /usr/lib @@ -45,12 +45,19 @@ /usr/lib/pkgconfig - qt5-base-devel + qt5-base-devel qt5-accountsservice + + 2023-06-17 + 1.3.0 + Rebuild qt5-5.15.10 + Mustafa Cinasal + muscnsl@gmail.com + 2022-12-21 1.3.0 diff --git a/desktop/toolkit/qt5/qt5-canvas3d/pspec.xml b/desktop/toolkit/qt5/qt5-canvas3d/pspec.xml index 559b9d859a..ccd52ba25d 100755 --- a/desktop/toolkit/qt5/qt5-canvas3d/pspec.xml +++ b/desktop/toolkit/qt5/qt5-canvas3d/pspec.xml @@ -17,16 +17,16 @@ A JavaScript 3D rendering API for Qt Quick https://github.com/qt/qtcanvas3d/archive/refs/tags/v5.12.12.tar.gz - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt5-canvas3d A JavaScript 3D rendering API for Qt Quick - qt5-base - qt5-declarative + qt5-base + qt5-declarative libgcc @@ -35,6 +35,13 @@ + + 2023-06-17 + 5.12.12 + Rebuild qt-5.15.10. + Mustafa Cinasal + muscnsl@gmail.com + 2022-12-21 5.12.12 diff --git a/desktop/toolkit/qt5/qt5-charts/pspec.xml b/desktop/toolkit/qt5/qt5-charts/pspec.xml index fe801c81d4..ee1f3628fa 100755 --- a/desktop/toolkit/qt5/qt5-charts/pspec.xml +++ b/desktop/toolkit/qt5/qt5-charts/pspec.xml @@ -11,18 +11,18 @@ GPL3 Provides a set of easy to use chart components Provides a set of easy to use chart components - http://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qtcharts-everywhere-opensource-src-5.15.9.tar.xz + http://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtcharts-everywhere-opensource-src-5.15.10.tar.xz - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt5-charts Provides a set of easy to use chart components - qt5-base - qt5-declarative + qt5-base + qt5-declarative libgcc @@ -36,7 +36,7 @@ qt5-charts-devel Development files for qt5-charts - qt5-base-devel + qt5-base-devel qt5-charts @@ -47,6 +47,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9 diff --git a/desktop/toolkit/qt5/qt5-datavis3d/pspec.xml b/desktop/toolkit/qt5/qt5-datavis3d/pspec.xml index c239a6d515..36d8dad385 100755 --- a/desktop/toolkit/qt5/qt5-datavis3d/pspec.xml +++ b/desktop/toolkit/qt5/qt5-datavis3d/pspec.xml @@ -12,18 +12,18 @@ desktop Provides a set of easy to use chart components Qt Data Visualization module - http://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qtdatavis3d-everywhere-opensource-src-5.15.9.tar.xz + http://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtdatavis3d-everywhere-opensource-src-5.15.10.tar.xz - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt5-datavis3d Qt Data Visualization module - qt5-base - qt5-declarative + qt5-base + qt5-declarative libgcc @@ -37,8 +37,8 @@ qt5-datavis3d-devel Development files for qt5-datavis3d - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt5-datavis3d @@ -49,6 +49,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9 diff --git a/desktop/toolkit/qt5/qt5-gamepad/pspec.xml b/desktop/toolkit/qt5/qt5-gamepad/pspec.xml index 970d9bc86b..4bf66b6b9d 100755 --- a/desktop/toolkit/qt5/qt5-gamepad/pspec.xml +++ b/desktop/toolkit/qt5/qt5-gamepad/pspec.xml @@ -15,12 +15,12 @@ desktop A JavaScript 3D rendering API for Qt Quick Adds support for getting events from gamepad devices - http://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qtgamepad-everywhere-opensource-src-5.15.9.tar.xz + http://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtgamepad-everywhere-opensource-src-5.15.10.tar.xz eudev-devel libsdl2-devel - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel @@ -30,8 +30,8 @@ eudev libgcc libsdl2 - qt5-base - qt5-declarative + qt5-base + qt5-declarative /usr/lib @@ -45,7 +45,7 @@ qt5-gamepad-devel Development files for qt5-gamepad - qt5-base-devel + qt5-base-devel qt5-gamepad @@ -56,6 +56,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9 diff --git a/desktop/toolkit/qt5/qt5-scxml/pspec.xml b/desktop/toolkit/qt5/qt5-scxml/pspec.xml index 0400fff067..2486497312 100755 --- a/desktop/toolkit/qt5/qt5-scxml/pspec.xml +++ b/desktop/toolkit/qt5/qt5-scxml/pspec.xml @@ -14,18 +14,18 @@ LGPL3 Provides a set of easy to use chart components Provides a set of easy to use chart components - http://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qtscxml-everywhere-opensource-src-5.15.9.tar.xz + http://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtscxml-everywhere-opensource-src-5.15.10.tar.xz - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt5-scxml Provides a set of easy to use chart components - qt5-base - qt5-declarative + qt5-base + qt5-declarative libgcc @@ -41,8 +41,8 @@ Development files for qt5-scxml qt5-scxml - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel /usr/include/qt5 @@ -52,6 +52,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9 diff --git a/desktop/toolkit/qt5/qt5-tools/files/qt_kde.patch b/desktop/toolkit/qt5/qt5-tools/files/qt_kde.patch index 149a731523..31075ea483 100644 --- a/desktop/toolkit/qt5/qt5-tools/files/qt_kde.patch +++ b/desktop/toolkit/qt5/qt5-tools/files/qt_kde.patch @@ -1,3 +1,15 @@ +diff --git a/src/assistant/help/help.pro b/src/assistant/help/help.pro +index 800c4a38d..7556f451b 100644 +--- a/src/assistant/help/help.pro ++++ b/src/assistant/help/help.pro +@@ -1,7 +1,6 @@ + TARGET = QtHelp + + QT = core-private gui widgets sql +-QT_PRIVATE = network + + DEFINES += QHELP_LIB + diff --git a/src/assistant/qhelpgenerator/helpgenerator.cpp b/src/assistant/qhelpgenerator/helpgenerator.cpp index feab1e2d5..cbfb82507 100644 --- a/src/assistant/qhelpgenerator/helpgenerator.cpp @@ -13,3 +25,82 @@ index feab1e2d5..cbfb82507 100644 m_query->prepare(QLatin1String("INSERT INTO FileAttributeSetTable " "VALUES(?, ?)")); m_query->bindValue(0, filterSetId); +diff --git a/src/assistant/qhelpgenerator/qhelpgenerator.pro b/src/assistant/qhelpgenerator/qhelpgenerator.pro +index bb22000c8..415347a00 100644 +--- a/src/assistant/qhelpgenerator/qhelpgenerator.pro ++++ b/src/assistant/qhelpgenerator/qhelpgenerator.pro +@@ -1,4 +1,4 @@ +-QT += network help-private ++QT += help-private + + QTPLUGIN.platforms = qminimal + QTPLUGIN.sqldrivers = qsqlite +diff --git a/src/linguist/Qt5LinguistToolsMacros.cmake b/src/linguist/Qt5LinguistToolsMacros.cmake +index 6a45e57be..0ccf59f3c 100644 +--- a/src/linguist/Qt5LinguistToolsMacros.cmake ++++ b/src/linguist/Qt5LinguistToolsMacros.cmake +@@ -68,6 +68,7 @@ function(QT5_CREATE_TRANSLATION _qm_files) + if(NOT EXISTS "${stamp_file_dir}") + file(MAKE_DIRECTORY "${stamp_file_dir}") + endif() ++ set(stamp_files "") + foreach(_ts_file ${_my_tsfiles}) + get_filename_component(_ts_name ${_ts_file} NAME) + if(_my_sources) +@@ -95,7 +96,14 @@ function(QT5_CREATE_TRANSLATION _qm_files) + + file(WRITE ${_ts_lst_file} "${_lst_file_srcs}") + endif() +- set(stamp_file "${stamp_file_dir}/${_ts_name}.stamp") ++ file(RELATIVE_PATH _ts_relative_path ${CMAKE_CURRENT_SOURCE_DIR} ${_ts_file}) ++ string(REPLACE "../" "__/" _ts_relative_path "${_ts_relative_path}") ++ set(stamp_file "${stamp_file_dir}/${_ts_relative_path}.stamp") ++ list(APPEND stamp_files ${stamp_file}) ++ get_filename_component(full_stamp_file_dir "${stamp_file}" DIRECTORY) ++ if(NOT EXISTS "${full_stamp_file_dir}") ++ file(MAKE_DIRECTORY "${full_stamp_file_dir}") ++ endif() + add_custom_command(OUTPUT ${stamp_file} + COMMAND ${Qt5_LUPDATE_EXECUTABLE} + ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file} +@@ -103,7 +111,7 @@ function(QT5_CREATE_TRANSLATION _qm_files) + DEPENDS ${_dependencies} + VERBATIM) + endforeach() +- qt5_add_translation(${_qm_files} __QT_INTERNAL_DEPEND_ON_TIMESTAMP_FILE ${_my_tsfiles}) ++ qt5_add_translation(${_qm_files} ${_my_tsfiles} __QT_INTERNAL_TIMESTAMP_FILES ${stamp_files}) + set(${_qm_files} ${${_qm_files}} PARENT_SCOPE) + endfunction() + +@@ -120,17 +128,17 @@ endif() + + + function(QT5_ADD_TRANSLATION _qm_files) +- set(options __QT_INTERNAL_DEPEND_ON_TIMESTAMP_FILE) ++ set(options) + set(oneValueArgs) +- set(multiValueArgs OPTIONS) ++ set(multiValueArgs OPTIONS __QT_INTERNAL_TIMESTAMP_FILES) + + cmake_parse_arguments(_LRELEASE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(_lrelease_files ${_LRELEASE_UNPARSED_ARGUMENTS}) + ++ set(idx 0) + foreach(_current_FILE ${_lrelease_files}) + get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) + get_filename_component(qm ${_abs_FILE} NAME) +- set(ts_stamp_file "${CMAKE_CURRENT_BINARY_DIR}/.lupdate/${qm}.stamp") + # everything before the last dot has to be considered the file name (including other dots) + string(REGEX REPLACE "\\.[^.]*$" "" FILE_NAME ${qm}) + get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION) +@@ -141,7 +149,9 @@ function(QT5_ADD_TRANSLATION _qm_files) + set(qm "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.qm") + endif() + +- if(_LRELEASE___QT_INTERNAL_DEPEND_ON_TIMESTAMP_FILE) ++ if(_LRELEASE___QT_INTERNAL_TIMESTAMP_FILES) ++ list(GET _LRELEASE___QT_INTERNAL_TIMESTAMP_FILES ${idx} ts_stamp_file) ++ math(EXPR idx "${idx} + 1") + set(qm_dep "${ts_stamp_file}") + else() + set(qm_dep "${_abs_FILE}") diff --git a/desktop/toolkit/qt5/qt5-tools/pspec.xml b/desktop/toolkit/qt5/qt5-tools/pspec.xml index 163bf9f31e..6aba5e161e 100755 --- a/desktop/toolkit/qt5/qt5-tools/pspec.xml +++ b/desktop/toolkit/qt5/qt5-tools/pspec.xml @@ -11,15 +11,15 @@ A cross-platform application and UI framework (Development Tools, QtHelp) A cross-platform application and UI framework (Development Tools, QtHelp) LGPLv2.1-linking-exception - http://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qttools-everywhere-opensource-src-5.15.9.tar.xz + http://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qttools-everywhere-opensource-src-5.15.10.tar.xz llvm mesa-devel llvm-clang-devel lld-devel - qt5-base-devel + qt5-base-devel icon-theme-hicolor - qt5-declarative-devel + qt5-declarative-devel qt_kde.patch @@ -32,8 +32,8 @@ libgcc llvm-libs llvm-clang - qt5-base - qt5-declarative + qt5-base + qt5-declarative /usr/bin/qdistancefieldgenerator @@ -70,7 +70,7 @@ qt5-assistant-devel - qt5-base-devel + qt5-base-devel qt5-assistant llvm-clang-devel @@ -86,8 +86,8 @@ qt5-designer libgcc - qt5-base - qt5-declarative + qt5-base + qt5-declarative /usr/bin/designer @@ -188,6 +188,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9 diff --git a/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch b/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch index ef0cc154aa..a8d1787668 100644 --- a/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch +++ b/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch @@ -30,7 +30,7 @@ index 2f424580..29222357 100644 + "use": "egl wayland-client" } }, - + diff --git a/src/client/global/qwaylandclientextension.cpp b/src/client/global/qwaylandclientextension.cpp index 125b1e19..edccfe63 100644 --- a/src/client/global/qwaylandclientextension.cpp @@ -45,12 +45,12 @@ index 125b1e19..edccfe63 100644 + d->registered = true; + } } - + QWaylandClientExtension::QWaylandClientExtension(const int ver) @@ -88,6 +91,13 @@ QWaylandClientExtension::QWaylandClientExtension(const int ver) QMetaObject::invokeMethod(this, "addRegistryListener", Qt::QueuedConnection); } - + +QWaylandClientExtension::~QWaylandClientExtension() +{ + Q_D(QWaylandClientExtension); @@ -70,7 +70,7 @@ index 98272e57..5bd28398 100644 public: QWaylandClientExtension(const int version); + ~QWaylandClientExtension(); - + QtWaylandClient::QWaylandIntegration *integration() const; int version() const; diff --git a/src/client/global/qwaylandclientextension_p.h b/src/client/global/qwaylandclientextension_p.h @@ -83,7 +83,7 @@ index 69cc46a0..9091efbe 100644 bool active = false; + bool registered = false; }; - + class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 81f48e05..14561c77 100644 @@ -96,14 +96,14 @@ index 81f48e05..14561c77 100644 + m_clientClipboard[QClipboard::Clipboard] = nullptr; + m_clientClipboard[QClipboard::Selection] = nullptr; } - + QWaylandClipboard::~QWaylandClipboard() { + if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]) + delete m_clientClipboard[QClipboard::Clipboard]; + delete m_clientClipboard[QClipboard::Selection]; } - + QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) @@ -69,8 +74,8 @@ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) switch (mode) { @@ -130,7 +130,7 @@ index 81f48e05..14561c77 100644 @@ -104,17 +109,27 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) if (data && data->hasFormat(plain) && !data->hasFormat(utf8)) data->setData(utf8, data->data(plain)); - + + if (m_clientClipboard[mode]) { + if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]) + delete m_clientClipboard[mode]; @@ -167,25 +167,25 @@ index ce14e124..bb52683d 100644 QMimeData m_emptyData; + QMimeData *m_clientClipboard[2]; }; - + } diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index 7e2e3308..e3e60ed5 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -72,6 +72,8 @@ QWaylandDataDevice::QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWayl - + QWaylandDataDevice::~QWaylandDataDevice() { + if (wl_data_device_get_version(object()) >= WL_DATA_DEVICE_RELEASE_SINCE_VERSION) + release(); } - + QWaylandDataOffer *QWaylandDataDevice::selectionOffer() const @@ -110,7 +112,7 @@ QWaylandDataOffer *QWaylandDataDevice::dragOffer() const return m_dragOffer.data(); } - + -bool QWaylandDataDevice::startDrag(QMimeData *mimeData, QWaylandWindow *icon) +bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supportedActions, QWaylandWindow *icon) { @@ -193,7 +193,7 @@ index 7e2e3308..e3e60ed5 100644 auto *origin = seat->pointerFocus(); @@ -123,7 +125,28 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, QWaylandWindow *icon) } - + m_dragSource.reset(new QWaylandDataSource(m_display->dndSelectionHandler(), mimeData)); + + if (wl_data_device_get_version(object()) >= 3) @@ -217,7 +217,7 @@ index 7e2e3308..e3e60ed5 100644 + connect(m_dragSource.data(), &QWaylandDataSource::finished, this, []() { + static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->finishDrag(); + }); - + start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial()); return true; @@ -152,7 +175,7 @@ void QWaylandDataDevice::data_device_drop() @@ -231,7 +231,7 @@ index 7e2e3308..e3e60ed5 100644 } @@ -162,7 +185,11 @@ void QWaylandDataDevice::data_device_drop() QGuiApplication::keyboardModifiers()); - + if (drag) { - static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->finishDrag(response); + auto drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag()); @@ -241,7 +241,7 @@ index 7e2e3308..e3e60ed5 100644 + m_dragOffer->finish(); } } - + @@ -186,7 +213,7 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, supportedActions = drag->supportedActions(); } else if (m_dragOffer) { @@ -249,12 +249,12 @@ index 7e2e3308..e3e60ed5 100644 - supportedActions = Qt::CopyAction | Qt::MoveAction | Qt::LinkAction; + supportedActions = m_dragOffer->supportedActions(); } - + const QPlatformDragQtResponse &response = QWindowSystemInterface::handleDrag(m_dragWindow, dragData, m_dragPoint, supportedActions, @@ -197,11 +224,7 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->setResponse(response); } - + - if (response.isAccepted()) { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); - } else { @@ -262,7 +262,7 @@ index 7e2e3308..e3e60ed5 100644 - } + sendResponse(supportedActions, response); } - + void QWaylandDataDevice::data_device_leave() @@ -235,10 +258,10 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe supportedActions = drag->supportedActions(); @@ -271,16 +271,16 @@ index 7e2e3308..e3e60ed5 100644 - supportedActions = Qt::CopyAction | Qt::MoveAction | Qt::LinkAction; + supportedActions = m_dragOffer->supportedActions(); } - + - QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(m_dragWindow, dragData, m_dragPoint, supportedActions, + const QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(m_dragWindow, dragData, m_dragPoint, supportedActions, QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); - + @@ -246,11 +269,7 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->setResponse(response); } - + - if (response.isAccepted()) { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); - } else { @@ -289,7 +289,7 @@ index 7e2e3308..e3e60ed5 100644 + sendResponse(supportedActions, response); } #endif // QT_CONFIG(draganddrop) - + @@ -277,14 +296,10 @@ void QWaylandDataDevice::selectionSourceCancelled() #if QT_CONFIG(draganddrop) void QWaylandDataDevice::dragSourceCancelled() @@ -297,7 +297,7 @@ index 7e2e3308..e3e60ed5 100644 + static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->finishDrag(); m_dragSource.reset(); } - + -void QWaylandDataDevice::dragSourceTargetChanged(const QString &mimeType) -{ - static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->updateTarget(mimeType); @@ -338,7 +338,7 @@ index 7e2e3308..e3e60ed5 100644 + + #endif // QT_CONFIG(draganddrop) - + } diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index 16c3ad28..801dcc2c 100644 @@ -346,28 +346,28 @@ index 16c3ad28..801dcc2c 100644 +++ b/src/client/qwaylanddatadevice_p.h @@ -64,6 +64,7 @@ QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE - + class QMimeData; +class QPlatformDragQtResponse; class QWindow; - + namespace QtWaylandClient { @@ -89,7 +90,7 @@ public: - + #if QT_CONFIG(draganddrop) QWaylandDataOffer *dragOffer() const; - bool startDrag(QMimeData *mimeData, QWaylandWindow *icon); + bool startDrag(QMimeData *mimeData, Qt::DropActions supportedActions, QWaylandWindow *icon); void cancelDrag(); #endif - + @@ -109,13 +110,16 @@ private Q_SLOTS: - + #if QT_CONFIG(draganddrop) void dragSourceCancelled(); - void dragSourceTargetChanged(const QString &mimeType); #endif - + private: #if QT_CONFIG(draganddrop) QPoint calculateDragPosition(int x, int y, QWindow *wnd) const; @@ -376,7 +376,7 @@ index 16c3ad28..801dcc2c 100644 + + static int dropActionsToWl(Qt::DropActions dropActions); + - + QWaylandDisplay *m_display = nullptr; QWaylandInputDevice *m_inputDevice = nullptr; diff --git a/src/client/qwaylanddatadevicemanager.cpp b/src/client/qwaylanddatadevicemanager.cpp @@ -384,9 +384,9 @@ index 35d67307..6dc4f77f 100644 --- a/src/client/qwaylanddatadevicemanager.cpp +++ b/src/client/qwaylanddatadevicemanager.cpp @@ -50,8 +50,8 @@ QT_BEGIN_NAMESPACE - + namespace QtWaylandClient { - + -QWaylandDataDeviceManager::QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id) - : wl_data_device_manager(display->wl_registry(), id, 1) +QWaylandDataDeviceManager::QWaylandDataDeviceManager(QWaylandDisplay *display, int version, uint32_t id) @@ -405,7 +405,7 @@ index bd05c0fb..510d9be4 100644 - QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id); + QWaylandDataDeviceManager(QWaylandDisplay *display, int version, uint32_t id); ~QWaylandDataDeviceManager() override; - + QWaylandDataDevice *getDataDevice(QWaylandInputDevice *inputDevice); diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index 2297e8a1..fe0ea8c9 100644 @@ -414,7 +414,7 @@ index 2297e8a1..fe0ea8c9 100644 @@ -82,6 +82,15 @@ QMimeData *QWaylandDataOffer::mimeData() return m_mimeData.data(); } - + +Qt::DropActions QWaylandDataOffer::supportedActions() const +{ + if (wl_data_offer_get_version(const_cast<::wl_data_offer*>(object())) < 3) { @@ -430,7 +430,7 @@ index 2297e8a1..fe0ea8c9 100644 @@ -93,6 +102,22 @@ void QWaylandDataOffer::data_offer_offer(const QString &mime_type) m_mimeData->appendFormat(mime_type); } - + +void QWaylandDataOffer::data_offer_action(uint32_t dnd_action) +{ + Q_UNUSED(dnd_action); @@ -451,7 +451,7 @@ index 2297e8a1..fe0ea8c9 100644 : m_dataOffer(dataOffer) { @@ -163,17 +188,18 @@ QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::T - + int QWaylandMimeData::readData(int fd, QByteArray &data) const { - fd_set readset; @@ -466,7 +466,7 @@ index 2297e8a1..fe0ea8c9 100644 - timeout.tv_usec = 0; + timeout.tv_nsec = 0; + - + Q_FOREVER { - int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout); + int ready = qt_safe_poll(&readset, 1, &timeout); @@ -485,23 +485,23 @@ index 9cf1483c..6f667398 100644 ~QWaylandDataOffer() override; QMimeData *mimeData() override; + Qt::DropActions supportedActions() const; - + QString firstFormat() const; - + @@ -89,10 +90,13 @@ public: - + protected: void data_offer_offer(const QString &mime_type) override; + void data_offer_source_actions(uint32_t source_actions) override; + void data_offer_action(uint32_t dnd_action) override; - + private: QWaylandDisplay *m_display = nullptr; QScopedPointer m_mimeData; + Qt::DropActions m_supportedActions; }; - - + + diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index f45122fb..e085152c 100644 --- a/src/client/qwaylanddatasource.cpp @@ -509,7 +509,7 @@ index f45122fb..e085152c 100644 @@ -71,11 +71,6 @@ QWaylandDataSource::~QWaylandDataSource() destroy(); } - + -QMimeData * QWaylandDataSource::mimeData() const -{ - return m_mime_data; @@ -519,7 +519,7 @@ index f45122fb..e085152c 100644 { Q_EMIT cancelled(); @@ -101,7 +96,32 @@ void QWaylandDataSource::data_source_send(const QString &mime_type, int32_t fd) - + void QWaylandDataSource::data_source_target(const QString &mime_type) { - Q_EMIT targetChanged(mime_type); @@ -550,7 +550,7 @@ index f45122fb..e085152c 100644 + + Q_EMIT dndDropped(m_accepted, m_dropAction); } - + } diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h index 25afff79..14d1542d 100644 @@ -559,7 +559,7 @@ index 25afff79..14d1542d 100644 @@ -74,20 +74,26 @@ public: QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData); ~QWaylandDataSource() override; - + - QMimeData *mimeData() const; - Q_SIGNALS: @@ -569,7 +569,7 @@ index 25afff79..14d1542d 100644 + + void dndResponseUpdated(bool accepted, Qt::DropAction action); + void dndDropped(bool accepted, Qt::DropAction action); - + protected: void data_source_cancelled() override; void data_source_send(const QString &mime_type, int32_t fd) override; @@ -577,23 +577,23 @@ index 25afff79..14d1542d 100644 + void data_source_dnd_drop_performed() override; + void data_source_dnd_finished() override; + void data_source_action(uint32_t action) override; - + private: QWaylandDisplay *m_display = nullptr; QMimeData *m_mime_data = nullptr; + bool m_accepted = false; + Qt::DropAction m_dropAction = Qt::IgnoreAction; }; - + } diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 78e387bc..27f55965 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -87,10 +87,203 @@ - + #include - + +#include // for std::tie + +static void checkWaylandError(struct wl_display *display) @@ -609,9 +609,9 @@ index 78e387bc..27f55965 100644 +} + QT_BEGIN_NAMESPACE - + namespace QtWaylandClient { - + +class EventThread : public QThread +{ + Q_OBJECT @@ -792,7 +792,7 @@ index 78e387bc..27f55965 100644 +}; + Q_LOGGING_CATEGORY(lcQpaWayland, "qt.qpa.wayland"); // for general (uncategorized) Wayland platform logging - + struct wl_surface *QWaylandDisplay::createSurface(void *handle) @@ -160,17 +353,16 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) if (!mXkbContext) @@ -806,7 +806,7 @@ index 78e387bc..27f55965 100644 - forceRoundTrip(); - } } - + QWaylandDisplay::~QWaylandDisplay(void) { + if (m_eventThread) @@ -817,7 +817,7 @@ index 78e387bc..27f55965 100644 + if (mSyncCallback) wl_callback_destroy(mSyncCallback); - + @@ -189,6 +381,21 @@ QWaylandDisplay::~QWaylandDisplay(void) #endif if (mDisplay) @@ -838,10 +838,10 @@ index 78e387bc..27f55965 100644 + forceRoundTrip(); + } } - + void QWaylandDisplay::ensureScreen() @@ -205,98 +412,37 @@ void QWaylandDisplay::ensureScreen() - + void QWaylandDisplay::checkError() const { - int ecode = wl_display_get_error(mDisplay); @@ -854,7 +854,7 @@ index 78e387bc..27f55965 100644 - _exit(1); + checkWaylandError(mDisplay); } - + +// Called in main thread, either from queued signal or directly. void QWaylandDisplay::flushRequests() { @@ -898,7 +898,7 @@ index 78e387bc..27f55965 100644 - delete q.mutex; + m_eventThread->readAndDispatchEvents(); } - + -QWaylandDisplay::FrameQueue QWaylandDisplay::createFrameQueue() +// We have to wait until we have an eventDispatcher before creating the eventThread, +// otherwise forceRoundTrip() may block inside _events_read() because eventThread is @@ -915,7 +915,7 @@ index 78e387bc..27f55965 100644 + connect(m_eventThread.get(), &EventThread::needReadAndDispatch, this, + &QWaylandDisplay::flushRequests, Qt::QueuedConnection); + m_eventThread->start(); - + -wl_event_queue *QWaylandDisplay::createEventQueue() -{ - return wl_display_create_queue(mDisplay); @@ -925,7 +925,7 @@ index 78e387bc..27f55965 100644 + new EventThread(mDisplay, m_frameEventQueue, EventThread::SelfDispatch)); + m_frameEventQueueThread->start(); } - + -void QWaylandDisplay::dispatchQueueWhile(wl_event_queue *queue, std::function condition, int timeout) +void QWaylandDisplay::blockingReadEvents() { @@ -957,7 +957,7 @@ index 78e387bc..27f55965 100644 + if (wl_display_dispatch(mDisplay) < 0) + checkWaylandError(mDisplay); } - + QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const @@ -347,7 +493,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin if (interface == QStringLiteral("wl_output")) { @@ -1001,7 +1001,7 @@ index 78e387bc..27f55965 100644 break; } @@ -456,9 +611,10 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data) - + void QWaylandDisplay::removeListener(RegistryListener listener, void *data) { - std::remove_if(mRegistryListeners.begin(), mRegistryListeners.end(), [=](Listener l){ @@ -1010,12 +1010,12 @@ index 78e387bc..27f55965 100644 }); + mRegistryListeners.erase(iter, mRegistryListeners.end()); } - + uint32_t QWaylandDisplay::currentTimeMillisec() @@ -471,50 +627,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec() return 0; } - + -static void -sync_callback(void *data, struct wl_callback *callback, uint32_t serial) -{ @@ -1062,12 +1062,12 @@ index 78e387bc..27f55965 100644 - wl_callback_destroy(callback); + wl_display_roundtrip(mDisplay); } - + bool QWaylandDisplay::supportsWindowDecoration() const @@ -578,14 +693,10 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic if (mLastKeyboardFocus == keyboardFocus) return; - + - if (mWaylandIntegration->mShellIntegration) { - mWaylandIntegration->mShellIntegration->handleKeyboardFocusChanged(keyboardFocus, mLastKeyboardFocus); - } else { @@ -1080,7 +1080,7 @@ index 78e387bc..27f55965 100644 + handleWindowActivated(keyboardFocus); + if (mLastKeyboardFocus) + handleWindowDeactivated(mLastKeyboardFocus); - + mLastKeyboardFocus = keyboardFocus; } @@ -604,6 +715,19 @@ void QWaylandDisplay::handleWaylandSync() @@ -1101,12 +1101,12 @@ index 78e387bc..27f55965 100644 + } + } } - + const wl_callback_listener QWaylandDisplay::syncCallbackListener = { @@ -630,6 +754,13 @@ QWaylandInputDevice *QWaylandDisplay::defaultInputDevice() const return mInputDevices.isEmpty() ? 0 : mInputDevices.first(); } - + +bool QWaylandDisplay::isKeyboardAvailable() const +{ + return std::any_of( @@ -1115,12 +1115,12 @@ index 78e387bc..27f55965 100644 +} + #if QT_CONFIG(cursor) - + QWaylandCursor *QWaylandDisplay::waylandCursor() @@ -656,4 +787,6 @@ QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(const QString &name, int p - + } // namespace QtWaylandClient - + +#include "qwaylanddisplay.moc" + QT_END_NAMESPACE @@ -1133,12 +1133,12 @@ index 1bad8b67..cf91b924 100644 class QWaylandCursor; class QWaylandCursorTheme; +class EventThread; - + typedef void (*RegistryListener)(void *data, struct wl_registry *registry, @@ -122,15 +123,11 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandDisplay : public QObject, public QtWayland Q_OBJECT - + public: - struct FrameQueue { - FrameQueue(wl_event_queue *q = nullptr) : queue(q), mutex(new QMutex) {} @@ -1148,7 +1148,7 @@ index 1bad8b67..cf91b924 100644 - QWaylandDisplay(QWaylandIntegration *waylandIntegration); ~QWaylandDisplay(void) override; - + + void initialize(); + #if QT_CONFIG(xkbcommon) @@ -1157,7 +1157,7 @@ index 1bad8b67..cf91b924 100644 @@ -214,11 +211,11 @@ public: void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); void handleWindowDestroyed(QWaylandWindow *window); - + - wl_event_queue *createEventQueue(); - FrameQueue createFrameQueue(); - void destroyFrameQueue(const FrameQueue &q); @@ -1165,14 +1165,14 @@ index 1bad8b67..cf91b924 100644 + wl_event_queue *frameEventQueue() { return m_frameEventQueue; }; + + bool isKeyboardAvailable() const; - + + void initEventThread(); public slots: void blockingReadEvents(); void flushRequests(); @@ -241,6 +238,9 @@ private: }; - + struct wl_display *mDisplay = nullptr; + QScopedPointer m_eventThread; + wl_event_queue *m_frameEventQueue = nullptr; @@ -1190,9 +1190,9 @@ index 1bad8b67..cf91b924 100644 struct wl_callback *mSyncCallback = nullptr; static const wl_callback_listener syncCallbackListener; - QReadWriteLock m_frameQueueLock; - + bool mClientSideInputContextRequested = !QPlatformInputContextFactory::requested().isNull(); - + diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index 6535aa16..7c53f5fa 100644 --- a/src/client/qwaylanddnd.cpp @@ -1208,18 +1208,18 @@ index 6535aa16..7c53f5fa 100644 // Cancelling immediately does not work, since the event loop for QDrag::exec is started @@ -80,6 +80,9 @@ void QWaylandDrag::cancel() QBasicDrag::cancel(); - + m_display->currentInputDevice()->dataDevice()->cancelDrag(); + + if (drag()) + drag()->deleteLater(); } - + void QWaylandDrag::move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) @@ -103,33 +106,41 @@ void QWaylandDrag::endDrag() m_display->currentInputDevice()->handleEndDrag(); } - + -void QWaylandDrag::updateTarget(const QString &mimeType) +void QWaylandDrag::setResponse(bool accepted) { @@ -1234,12 +1234,12 @@ index 6535aa16..7c53f5fa 100644 + Qt::DropAction action = defaultAction(drag()->supportedActions(), m_display->currentInputDevice()->modifiers()); + setResponse(QPlatformDropQtResponse(accepted, action)); } - + -void QWaylandDrag::setResponse(const QPlatformDragQtResponse &response) +void QWaylandDrag::setResponse(const QPlatformDropQtResponse &response) { setCanDrop(response.isAccepted()); - + if (canDrop()) { - updateCursor(defaultAction(drag()->supportedActions(), m_display->currentInputDevice()->modifiers())); + updateCursor(response.acceptedAction()); @@ -1247,7 +1247,7 @@ index 6535aa16..7c53f5fa 100644 updateCursor(Qt::IgnoreAction); } } - + -void QWaylandDrag::finishDrag(const QPlatformDropQtResponse &response) +void QWaylandDrag::setDropResponse(const QPlatformDropQtResponse &response) { @@ -1267,7 +1267,7 @@ index 6535aa16..7c53f5fa 100644 +{ + return true; } - + } diff --git a/src/client/qwaylanddnd_p.h b/src/client/qwaylanddnd_p.h index 474fe2ab..46f629ac 100644 @@ -1276,7 +1276,7 @@ index 474fe2ab..46f629ac 100644 @@ -71,9 +71,10 @@ public: QWaylandDrag(QWaylandDisplay *display); ~QWaylandDrag() override; - + - void updateTarget(const QString &mimeType); - void setResponse(const QPlatformDragQtResponse &response); - void finishDrag(const QPlatformDropQtResponse &response); @@ -1284,15 +1284,15 @@ index 474fe2ab..46f629ac 100644 + void setResponse(const QPlatformDropQtResponse &response); + void setDropResponse(const QPlatformDropQtResponse &response); + void finishDrag(); - + protected: void startDrag() override; @@ -82,6 +83,7 @@ protected: void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; - + + bool ownsDragObject() const override; - + private: QWaylandDisplay *m_display = nullptr; diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp @@ -1301,14 +1301,14 @@ index e931d1f5..9a0fe49d 100644 +++ b/src/client/qwaylandinputdevice.cpp @@ -310,8 +310,7 @@ void QWaylandInputDevice::Pointer::updateCursor() auto shape = seat()->mCursor.shape; - + if (shape == Qt::BlankCursor) { - if (mCursor.surface) - mCursor.surface->hide(); + getOrCreateCursorSurface()->hide(); return; } - + @@ -1304,14 +1303,6 @@ void QWaylandInputDevice::Keyboard::handleFocusDestroyed() void QWaylandInputDevice::Keyboard::handleFocusLost() { @@ -1327,27 +1327,27 @@ index e931d1f5..9a0fe49d 100644 @@ -1400,6 +1391,7 @@ void QWaylandInputDevice::Touch::touch_cancel() if (touchExt) touchExt->touchCanceled(); - + + mFocus = nullptr; QWindowSystemInterface::handleTouchCancelEvent(nullptr, mParent->mTouchDevice); } - + diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index d257e2e3..54861600 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -125,6 +125,9 @@ QWaylandIntegration::QWaylandIntegration() #endif - + reconfigureInputContext(); + + QWaylandWindow::fixedToplevelPositions = + !qEnvironmentVariableIsSet("QT_WAYLAND_DISABLE_FIXED_POSITIONS"); } - + QWaylandIntegration::~QWaylandIntegration() @@ -192,14 +195,18 @@ QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const - + void QWaylandIntegration::initialize() { + mDisplay->initEventThread(); @@ -1361,7 +1361,7 @@ index d257e2e3..54861600 100644 QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay.data(), SLOT(flushRequests())); QObject::connect(dispatcher, SIGNAL(awake()), mDisplay.data(), SLOT(flushRequests())); - + - int fd = wl_display_get_fd(mDisplay->wl_display()); - QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data()); - QObject::connect(sn, SIGNAL(activated(QSocketDescriptor)), mDisplay.data(), SLOT(flushRequests())); @@ -1372,7 +1372,7 @@ index d257e2e3..54861600 100644 @@ -262,6 +269,14 @@ QWaylandDisplay *QWaylandIntegration::display() const return mDisplay.data(); } - + +Qt::KeyboardModifiers QWaylandIntegration::queryKeyboardModifiers() const +{ + if (auto *seat = mDisplay->currentInputDevice()) { @@ -1389,13 +1389,13 @@ index ff70ae25..73b80658 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -107,6 +107,8 @@ public: - + QWaylandDisplay *display() const; - + + Qt::KeyboardModifiers queryKeyboardModifiers() const override; + QList possibleKeys(const QKeyEvent *event) const override; - + QStringList themeNames() const override; diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index bf54a1a0..9763c312 100644 @@ -1404,11 +1404,11 @@ index bf54a1a0..9763c312 100644 @@ -139,7 +139,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc { QByteArray lowerCaseResource = resourceString.toLower(); - + - if (lowerCaseResource == "output") + if (lowerCaseResource == "output" && !screen->handle()->isPlaceholder()) return ((QWaylandScreen *) screen->handle())->output(); - + return nullptr; diff --git a/src/client/qwaylandprimaryselectionv1.cpp b/src/client/qwaylandprimaryselectionv1.cpp index 832f9678..ea508771 100644 @@ -1424,7 +1424,7 @@ index 832f9678..ea508771 100644 - for (auto *seat : seats) - seat->setPrimarySelectionDevice(createDevice(seat)); } - + QWaylandPrimarySelectionDeviceV1 *QWaylandPrimarySelectionDeviceManagerV1::createDevice(QWaylandInputDevice *seat) diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index 6cb337de..5537dafd 100644 @@ -1432,7 +1432,7 @@ index 6cb337de..5537dafd 100644 +++ b/src/client/qwaylandscreen.cpp @@ -60,7 +60,7 @@ QWaylandXdgOutputManagerV1::QWaylandXdgOutputManagerV1(QWaylandDisplay* display, } - + QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id) - : QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 2)) + : QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 3)) @@ -1468,11 +1468,11 @@ index 6cb337de..5537dafd 100644 + } + return ret; } - + void QWaylandScreen::maybeInitialize() { Q_ASSERT(!mInitialized); - + - if (!mOutputDone) - return; - @@ -1480,10 +1480,10 @@ index 6cb337de..5537dafd 100644 + const uint requiredEvents = this->requiredEvents(); + if ((mProcessedEvents & requiredEvents) != requiredEvents) return; - + mInitialized = true; @@ -276,9 +289,8 @@ void QWaylandScreen::output_scale(int32_t factor) - + void QWaylandScreen::output_done() { - mOutputDone = true; @@ -1497,14 +1497,14 @@ index 6cb337de..5537dafd 100644 @@ -339,7 +351,7 @@ void QWaylandScreen::zxdg_output_v1_done() if (Q_UNLIKELY(mWaylandDisplay->xdgOutputManager()->version() >= 3)) qWarning(lcQpaWayland) << "zxdg_output_v1.done received on version 3 or newer, this is most likely a bug in the compositor"; - + - mXdgOutputDone = true; + mProcessedEvents |= XdgOutputDoneEvent; if (mInitialized) updateXdgOutputProperties(); else @@ -348,7 +360,11 @@ void QWaylandScreen::zxdg_output_v1_done() - + void QWaylandScreen::zxdg_output_v1_name(const QString &name) { + if (Q_UNLIKELY(mInitialized)) @@ -1513,7 +1513,7 @@ index 6cb337de..5537dafd 100644 mOutputName = name; + mProcessedEvents |= XdgOutputNameEvent; } - + void QWaylandScreen::updateXdgOutputProperties() diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index df1c94f2..050cfdc0 100644 @@ -1521,7 +1521,7 @@ index df1c94f2..050cfdc0 100644 +++ b/src/client/qwaylandscreen_p.h @@ -116,6 +116,13 @@ public: static QWaylandScreen *fromWlOutput(::wl_output *output); - + private: + enum Event : uint { + XdgOutputDoneEvent = 0x1, @@ -1541,20 +1541,20 @@ index df1c94f2..050cfdc0 100644 - bool mXdgOutputDone = false; + uint mProcessedEvents = 0; bool mInitialized = false; - + #if QT_CONFIG(cursor) diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index dc7ff670..41cffdf7 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -52,6 +52,7 @@ - + #include - + +#include #include #include - + @@ -61,6 +62,9 @@ # ifndef MFD_CLOEXEC # define MFD_CLOEXEC 0x0001U @@ -1563,12 +1563,12 @@ index dc7ff670..41cffdf7 100644 +# define MFD_ALLOW_SEALING 0x0002U +# endif #endif - + QT_BEGIN_NAMESPACE @@ -74,8 +78,10 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, int alloc = stride * size.height(); int fd = -1; - + -#ifdef SYS_memfd_create - fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC); +#if defined(SYS_memfd_create) && defined(F_SEAL_SEAL) @@ -1576,7 +1576,7 @@ index dc7ff670..41cffdf7 100644 + if (fd >= 0) + fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); #endif - + QScopedPointer filePointer; diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index df2dcdaa..3b700002 100644 @@ -1591,17 +1591,17 @@ index df2dcdaa..3b700002 100644 { { @@ -95,9 +94,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) - + QWaylandWindow::~QWaylandWindow() { - mDisplay->destroyFrameQueue(mFrameQueue); - mDisplay->handleWindowDestroyed(this); - delete mWindowDecoration; - + if (mSurface) @@ -243,6 +239,7 @@ bool QWaylandWindow::shouldCreateSubSurface() const - + void QWaylandWindow::reset() { + closeChildPopups(); @@ -1611,7 +1611,7 @@ index df2dcdaa..3b700002 100644 @@ -255,17 +252,22 @@ void QWaylandWindow::reset() mSurface.reset(); } - + - if (mFrameCallback) { - wl_callback_destroy(mFrameCallback); - mFrameCallback = nullptr; @@ -1622,25 +1622,25 @@ index df2dcdaa..3b700002 100644 + wl_callback_destroy(mFrameCallback); + mFrameCallback = nullptr; + } - + - mFrameCallbackElapsedTimer.invalidate(); - mWaitingForFrameCallback = false; + mFrameCallbackElapsedTimer.invalidate(); + mWaitingForFrameCallback = false; + } mFrameCallbackTimedOut = false; - + mMask = QRegion(); mQueuedBuffer = nullptr; + + mDisplay->handleWindowDestroyed(this); } - + QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface) @@ -351,19 +353,25 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) } } - + -void QWaylandWindow::setGeometry(const QRect &rect) +void QWaylandWindow::setGeometry(const QRect &r) { @@ -1650,11 +1650,11 @@ index df2dcdaa..3b700002 100644 + rect.moveTo(screen()->geometry().topLeft()); + } setGeometry_helper(rect); - + if (window()->isVisible() && rect.isValid()) { if (mWindowDecoration) mWindowDecoration->update(); - + - if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize) + if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize) { + QMutexLocker lock(&mResizeLock); @@ -1669,17 +1669,17 @@ index df2dcdaa..3b700002 100644 QRect exposeGeometry(QPoint(), geometry().size()); @@ -374,7 +382,7 @@ void QWaylandWindow::setGeometry(const QRect &rect) mShellSurface->setWindowGeometry(windowContentGeometry()); - + if (isOpaque() && mMask.isEmpty()) - setOpaqueArea(rect); + setOpaqueArea(QRect(QPoint(0, 0), rect.size())); } - + void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) @@ -399,21 +407,6 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect) mLastExposeGeometry = rect; } - + - -static QVector> activePopups; - @@ -1700,13 +1700,13 @@ index df2dcdaa..3b700002 100644 QReadLocker lock(&mSurfaceLock); @@ -433,10 +426,7 @@ void QWaylandWindow::setVisible(bool visible) lastVisible = visible; - + if (visible) { - if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip) - activePopups << this; initWindow(); - mDisplay->flushRequests(); - + setGeometry(windowGeometry()); // Don't flush the events here, or else the newly visible window may start drawing, but since @@ -444,7 +434,6 @@ void QWaylandWindow::setVisible(bool visible) @@ -1718,23 +1718,23 @@ index df2dcdaa..3b700002 100644 } } @@ -556,12 +545,12 @@ void QWaylandWindow::sendRecursiveExposeEvent() - + void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y) { - Q_ASSERT(!buffer->committed()); QReadLocker locker(&mSurfaceLock); if (mSurface == nullptr) return; - + if (buffer) { + Q_ASSERT(!buffer->committed()); handleUpdate(); buffer->setBusy(); - + @@ -583,7 +572,11 @@ void QWaylandWindow::damage(const QRect &rect) if (mSurface == nullptr) return; - + - mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); + const int s = scale(); + if (mDisplay->compositorVersion() >= 4) @@ -1742,11 +1742,11 @@ index df2dcdaa..3b700002 100644 + else + mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); } - + void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage) @@ -619,8 +612,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage) return; - + attachOffset(buffer); - for (const QRect &rect: damage) - mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height()); @@ -1762,7 +1762,7 @@ index df2dcdaa..3b700002 100644 buffer->setCommitted(); mSurface->commit(); @@ -635,42 +634,53 @@ void QWaylandWindow::commit() - + const wl_callback_listener QWaylandWindow::callbackListener = { [](void *data, wl_callback *callback, uint32_t time) { - Q_UNUSED(callback); @@ -1772,7 +1772,7 @@ index df2dcdaa..3b700002 100644 + window->handleFrameCallback(callback); } }; - + -void QWaylandWindow::handleFrameCallback() +void QWaylandWindow::handleFrameCallback(wl_callback* callback) { @@ -1788,7 +1788,7 @@ index df2dcdaa..3b700002 100644 + mWaitingForFrameCallback = false; mFrameCallbackElapsedTimer.invalidate(); - + // The rest can wait until we can run it on the correct thread - if (!mWaitingForUpdateDelivery) { - auto doHandleExpose = [this]() { @@ -1810,7 +1810,7 @@ index df2dcdaa..3b700002 100644 + if (wasExposed && hasPendingUpdateRequest()) + deliverUpdateRequest(); + }; - + + if (mWaitingForUpdateDelivery.testAndSetAcquire(false, true)) { // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync() // in the single-threaded case. @@ -1820,7 +1820,7 @@ index df2dcdaa..3b700002 100644 + + mFrameSyncWait.notify_all(); } - + bool QWaylandWindow::waitForFrameSync(int timeout) { - QMutexLocker locker(mFrameQueue.mutex); @@ -1829,7 +1829,7 @@ index df2dcdaa..3b700002 100644 + + QDeadlineTimer deadline(timeout); + while (mWaitingForFrameCallback && mFrameSyncWait.wait(&mFrameSyncMutex, deadline)) { } - + if (mWaitingForFrameCallback) { qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed"; @@ -874,7 +884,11 @@ bool QWaylandWindow::createDecoration() @@ -1843,12 +1843,12 @@ index df2dcdaa..3b700002 100644 + // here to avoid asserts. + QMetaObject::invokeMethod(window(), &QWindow::requestUpdate); } - + return mWindowDecoration; @@ -1028,8 +1042,17 @@ void QWaylandWindow::handleScreensChanged() if (newScreen == mLastReportedScreen) return; - + + if (!newScreen->isPlaceholder() && !newScreen->QPlatformScreen::screen()) + mDisplay->forceRoundTrip(); QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen()); @@ -1860,13 +1860,13 @@ index df2dcdaa..3b700002 100644 + geometry.moveTo(newScreen->geometry().topLeft()); + setGeometry(geometry); + } - + int scale = newScreen->isPlaceholder() ? 1 : static_cast(newScreen)->scale(); if (scale != mScale) { @@ -1101,10 +1124,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab) return true; } - + +Qt::WindowStates QWaylandWindow::windowStates() const +{ + return mLastReportedWindowStates; @@ -1882,11 +1882,11 @@ index df2dcdaa..3b700002 100644 + lastStatesWithoutActive); mLastReportedWindowStates = states; } - + @@ -1146,19 +1177,24 @@ void QWaylandWindow::timerEvent(QTimerEvent *event) if (event->timerId() != mFrameCallbackCheckIntervalTimerId) return; - + - bool callbackTimerExpired = mFrameCallbackElapsedTimer.hasExpired(mFrameCallbackTimeout); - if (!mFrameCallbackElapsedTimer.isValid() || callbackTimerExpired ) { - killTimer(mFrameCallbackCheckIntervalTimerId); @@ -1896,7 +1896,7 @@ index df2dcdaa..3b700002 100644 - mFrameCallbackElapsedTimer.invalidate(); + { + QMutexLocker lock(&mFrameSyncMutex); - + - qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed"; - mFrameCallbackTimedOut = true; - mWaitingForUpdate = false; @@ -1917,11 +1917,11 @@ index df2dcdaa..3b700002 100644 + mWaitingForUpdate = false; + sendExposeEvent(QRect()); } - + void QWaylandWindow::requestUpdate() @@ -1167,8 +1203,11 @@ void QWaylandWindow::requestUpdate() Q_ASSERT(hasPendingUpdateRequest()); // should be set by QPA - + // If we have a frame callback all is good and will be taken care of there - if (mWaitingForFrameCallback) - return; @@ -1930,7 +1930,7 @@ index df2dcdaa..3b700002 100644 + if (mWaitingForFrameCallback) + return; + } - + // If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet // This is a somewhat redundant behavior and might indicate a bug in the calling code, so log @@ -1181,7 +1220,12 @@ void QWaylandWindow::requestUpdate() @@ -1956,7 +1956,7 @@ index df2dcdaa..3b700002 100644 QReadLocker lock(&mSurfaceLock); if (!mSurface) return; - + - if (mFrameCallback) { - wl_callback_destroy(mFrameCallback); - mFrameCallback = nullptr; @@ -1964,7 +1964,7 @@ index df2dcdaa..3b700002 100644 + QMutexLocker locker(&mFrameSyncMutex); + if (mWaitingForFrameCallback) + return; - + - QMutexLocker locker(mFrameQueue.mutex); struct ::wl_surface *wrappedSurface = reinterpret_cast(wl_proxy_create_wrapper(mSurface->object())); - wl_proxy_set_queue(reinterpret_cast(wrappedSurface), mFrameQueue.queue); @@ -1984,7 +1984,7 @@ index df2dcdaa..3b700002 100644 @@ -1274,6 +1319,20 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea) wl_region_destroy(region); } - + +void QWaylandWindow::addChildPopup(QWaylandWindow *surface) { + mChildPopups.append(surface); +} @@ -2000,7 +2000,7 @@ index df2dcdaa..3b700002 100644 + } +} } - + QT_END_NAMESPACE diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index 01337cff..2f219d8c 100644 @@ -2009,7 +2009,7 @@ index 01337cff..2f219d8c 100644 @@ -98,6 +98,9 @@ public: QWaylandWindow(QWindow *window, QWaylandDisplay *display); ~QWaylandWindow() override; - + + // Keep Toplevels position on the top left corner of their screen + static inline bool fixedToplevelPositions = true; + @@ -2021,22 +2021,22 @@ index 01337cff..2f219d8c 100644 void setWindowFlags(Qt::WindowFlags flags) override; void handleWindowStatesChanged(Qt::WindowStates states); + Qt::WindowStates windowStates() const; - + void raise() override; void lower() override; @@ -206,6 +210,10 @@ public: void handleUpdate(); void deliverUpdateRequest() override; - + + void addChildPopup(QWaylandWindow* child); + void removeChildPopup(QWaylandWindow* child); + void closeChildPopups(); + public slots: void applyConfigure(); - + @@ -215,7 +223,11 @@ signals: - + protected: QWaylandDisplay *mDisplay = nullptr; + @@ -2049,7 +2049,7 @@ index 01337cff..2f219d8c 100644 QVector mChildren; @@ -225,13 +237,14 @@ protected: Qt::MouseButtons mMousePressedInContentArea = Qt::NoButton; - + WId mWindowId; - bool mWaitingForFrameCallback = false; bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out @@ -2065,12 +2065,12 @@ index 01337cff..2f219d8c 100644 + struct ::wl_callback *mFrameCallback = nullptr; // Protected by mFrameSyncMutex + QMutex mFrameSyncMutex; QWaitCondition mFrameSyncWait; - + // True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer @@ -261,6 +274,8 @@ protected: QWaylandBuffer *mQueuedBuffer = nullptr; QRegion mQueuedBufferDamage; - + + QList> mChildPopups; + private: @@ -2078,18 +2078,18 @@ index 01337cff..2f219d8c 100644 void initWindow(); @@ -283,12 +298,10 @@ private: QRect mLastExposeGeometry; - + static const wl_callback_listener callbackListener; - void handleFrameCallback(); + void handleFrameCallback(struct ::wl_callback* callback); - + static QWaylandWindow *mMouseGrab; - + - mutable QReadWriteLock mSurfaceLock; - friend class QWaylandSubSurface; }; - + diff --git a/src/client/shellintegration/qwaylandshellintegration_p.h b/src/client/shellintegration/qwaylandshellintegration_p.h index ccad0048..4cc9b3b8 100644 --- a/src/client/shellintegration/qwaylandshellintegration_p.h @@ -2115,7 +2115,7 @@ index bcfd5215..da95d07b 100644 +++ b/src/compositor/configure.json @@ -7,6 +7,31 @@ "testDir": "../../config.tests", - + "libraries": { + "wayland-client": { + "label": "Wayland client library", @@ -2174,18 +2174,18 @@ index bcfd5215..da95d07b 100644 + "use": "wayland-client" } }, - + diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 57d4eb6b..872a6237 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -40,6 +40,7 @@ #include "qwaylandeglwindow.h" - + #include +#include #include "qwaylandglcontext.h" - + #include @@ -115,6 +116,7 @@ void QWaylandEglWindow::updateSurface(bool create) } @@ -2204,7 +2204,7 @@ index 57d4eb6b..872a6237 100644 wl_egl_window_resize(m_waylandEglWindow, sizeWithMargins.width(), sizeWithMargins.height(), mOffset.x(), mOffset.y()); + m_requestedSize = sizeWithMargins; mOffset = QPoint(); - + m_resize = true; } - } else if (create && wlSurface()) { @@ -2213,7 +2213,7 @@ index 57d4eb6b..872a6237 100644 + m_waylandEglWindow = wl_egl_window_create(mSurface->object(), sizeWithMargins.width(), sizeWithMargins.height()); + m_requestedSize = sizeWithMargins; } - + if (!m_eglSurface && m_waylandEglWindow && create) { diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 6c8f04ec..94c56325 100644 @@ -2221,11 +2221,11 @@ index 6c8f04ec..94c56325 100644 +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -87,6 +87,7 @@ private: mutable QOpenGLFramebufferObject *m_contentFBO = nullptr; - + QSurfaceFormat m_format; + QSize m_requestedSize; }; - + } diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h index 56a710c3..c6a8b6c6 100644 @@ -2234,20 +2234,20 @@ index 56a710c3..c6a8b6c6 100644 @@ -41,6 +41,8 @@ #include #include - + +#include + #include #include - + diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp index 85d25e3c..60bdd491 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp @@ -47,18 +47,21 @@ QT_BEGIN_NAMESPACE - + namespace QtWaylandClient { - + -QWaylandXdgPopupV5::QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow *window) +QWaylandXdgPopupV5::QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow* parent, QWaylandWindow *window) : QWaylandShellSurface(window) @@ -2259,14 +2259,14 @@ index 85d25e3c..60bdd491 100644 m_extendedWindow = new QWaylandExtendedSurface(window); + m_parent->addChildPopup(m_window); } - + QWaylandXdgPopupV5::~QWaylandXdgPopupV5() { xdg_popup_destroy(object()); + m_parent->removeChildPopup(m_window); delete m_extendedWindow; } - + diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h index 7494f6a6..d85f130b 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h @@ -2278,16 +2278,16 @@ index 7494f6a6..d85f130b 100644 - QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow *window); + QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow* parent, QWaylandWindow *window); ~QWaylandXdgPopupV5() override; - + protected: @@ -78,6 +78,7 @@ protected: - + private: QWaylandExtendedSurface *m_extendedWindow = nullptr; + QWaylandWindow *m_parent = nullptr; QWaylandWindow *m_window = nullptr; }; - + diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp index 7e242c4a..def8452a 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp @@ -2295,7 +2295,7 @@ index 7e242c4a..def8452a 100644 @@ -84,7 +84,7 @@ QWaylandXdgPopupV5 *QWaylandXdgShellV5::createXdgPopup(QWaylandWindow *window, Q int x = position.x() + parentWindow->frameMargins().left(); int y = position.y() + parentWindow->frameMargins().top(); - + - auto popup = new QWaylandXdgPopupV5(get_xdg_popup(window->wlSurface(), parentSurface, seat, m_popupSerial, x, y), window); + auto popup = new QWaylandXdgPopupV5(get_xdg_popup(window->wlSurface(), parentSurface, seat, m_popupSerial, x, y), parentWindow, window); m_popups.append(window); @@ -2308,7 +2308,7 @@ index 4e25949f..cfc60939 100644 @@ -85,13 +85,6 @@ QWaylandShellSurface *QWaylandXdgShellV5Integration::createShellSurface(QWayland return m_xdgShell->createXdgSurface(window); } - + -void QWaylandXdgShellV5Integration::handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) { - if (newFocus && qobject_cast(newFocus->shellSurface())) - m_display->handleWindowActivated(newFocus); @@ -2317,7 +2317,7 @@ index 4e25949f..cfc60939 100644 -} - } - + QT_END_NAMESPACE diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5integration_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5integration_p.h index ce6bdb9e..aed88670 100644 @@ -2328,7 +2328,7 @@ index ce6bdb9e..aed88670 100644 bool initialize(QWaylandDisplay *display) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; - void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) override; - + private: QScopedPointer m_xdgShell; diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp @@ -2341,12 +2341,12 @@ index 8c371661..151c78e3 100644 { + m_parent->window()->addChildPopup(m_xdgSurface->window()); } - + QWaylandXdgSurfaceV6::Popup::~Popup() @@ -181,6 +182,8 @@ QWaylandXdgSurfaceV6::Popup::~Popup() if (isInitialized()) destroy(); - + + m_parent->window()->removeChildPopup(m_xdgSurface->window()); + if (m_grabbing) { @@ -2359,7 +2359,7 @@ index 03164316..e8da8ba1 100644 @@ -68,20 +68,6 @@ QWaylandShellSurface *QWaylandXdgShellV6Integration::createShellSurface(QWayland return m_xdgShell->getXdgSurface(window); } - + -void QWaylandXdgShellV6Integration::handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) -{ - if (newFocus) { @@ -2375,7 +2375,7 @@ index 03164316..e8da8ba1 100644 -} - } - + QT_END_NAMESPACE diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration_p.h b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6integration_p.h index 261f8cbb..c1bcd5c6 100644 @@ -2386,15 +2386,15 @@ index 261f8cbb..c1bcd5c6 100644 bool initialize(QWaylandDisplay *display) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; - void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) override; - + private: QScopedPointer m_xdgShell; diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index f50e1c0e..822b385c 100644 +index fa9c01aa..822b385c 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -67,11 +67,6 @@ QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface) - + QWaylandXdgSurface::Toplevel::~Toplevel() { - if (m_applied.states & Qt::WindowActive) { @@ -2408,29 +2408,29 @@ index f50e1c0e..822b385c 100644 @@ -85,16 +80,15 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() if (!(m_applied.states & (Qt::WindowMaximized|Qt::WindowFullScreen))) m_normalSize = m_xdgSurface->m_window->windowFrameGeometry().size(); - + - if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive)) + if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive) + && !m_xdgSurface->m_window->display()->isKeyboardAvailable()) m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window); - + - if (!(m_pending.states & Qt::WindowActive) && (m_applied.states & Qt::WindowActive)) + if (!(m_pending.states & Qt::WindowActive) && (m_applied.states & Qt::WindowActive) + && !m_xdgSurface->m_window->display()->isKeyboardAvailable()) m_xdgSurface->m_window->display()->handleWindowDeactivated(m_xdgSurface->m_window); - + - // TODO: none of the other plugins send WindowActive either, but is it on purpose? - Qt::WindowStates statesWithoutActive = m_pending.states & ~Qt::WindowActive; - - m_xdgSurface->m_window->handleWindowStatesChanged(statesWithoutActive); + m_xdgSurface->m_window->handleWindowStatesChanged(m_pending.states); - + if (m_pending.size.isEmpty()) { // An empty size in the configure means it's up to the client to choose the size @@ -105,8 +99,6 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size); } - + - m_xdgSurface->setSizeHints(); - m_applied = m_pending; @@ -2439,7 +2439,7 @@ index f50e1c0e..822b385c 100644 @@ -203,12 +195,17 @@ QtWayland::xdg_toplevel::resize_edge QWaylandXdgSurface::Toplevel::convertToResi | ((edges & Qt::RightEdge) ? resize_edge_right : 0)); } - + -QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent, +QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent, QtWayland::xdg_positioner *positioner) @@ -2455,12 +2455,12 @@ index f50e1c0e..822b385c 100644 + m_parent->addChildPopup(m_xdgSurface->window()); + } } - + QWaylandXdgSurface::Popup::~Popup() -@@ -216,10 +213,24 @@ QWaylandXdgSurface::Popup::~Popup() +@@ -216,10 +213,14 @@ QWaylandXdgSurface::Popup::~Popup() if (isInitialized()) destroy(); - + + if (m_parent) { + m_parent->removeChildPopup(m_xdgSurface->window()); + } @@ -2470,31 +2470,21 @@ index f50e1c0e..822b385c 100644 Q_ASSERT(shell->m_topmostGrabbingPopup == this); - shell->m_topmostGrabbingPopup = m_parent->m_popup; + shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr; -+ m_grabbing = false; -+ -+ // Synthesize Qt enter/leave events for popup -+ QWindow *leave = nullptr; -+ if (m_xdgSurface && m_xdgSurface->window()) -+ leave = m_xdgSurface->window()->window(); -+ QWindowSystemInterface::handleLeaveEvent(leave); -+ -+ if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos())) -+ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); - } - } - -@@ -257,6 +268,7 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s + m_grabbing = false; + + // Synthesize Qt enter/leave events for popup +@@ -267,6 +268,7 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); } } + setSizeHints(); } - + QWaylandXdgSurface::~QWaylandXdgSurface() -@@ -372,10 +384,10 @@ void QWaylandXdgSurface::setSizeHints() +@@ -382,10 +384,10 @@ void QWaylandXdgSurface::setSizeHints() const int minHeight = qMax(0, m_window->windowMinimumSize().height()); m_toplevel->set_min_size(minWidth, minHeight); - + - int maxWidth = qMax(0, m_window->windowMaximumSize().width()); + int maxWidth = qMax(minWidth, m_window->windowMaximumSize().width()); if (maxWidth == QWINDOWSIZE_MAX) @@ -2504,16 +2494,16 @@ index f50e1c0e..822b385c 100644 if (maxHeight == QWINDOWSIZE_MAX) maxHeight = 0; m_toplevel->set_max_size(maxWidth, maxHeight); -@@ -400,8 +412,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) +@@ -410,8 +412,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) { Q_ASSERT(!m_toplevel && !m_popup); - + - auto parentXdgSurface = static_cast(parent->shellSurface()); - auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner()); // set_popup expects a position relative to the parent QPoint transientPos = m_window->geometry().topLeft(); // this is absolute -@@ -415,11 +425,10 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) +@@ -425,11 +425,10 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right); positioner->set_size(m_window->geometry().width(), m_window->geometry().height()); positioner->set_constraint_adjustment(QtWayland::xdg_positioner::constraint_adjustment_slide_x @@ -2527,53 +2517,29 @@ index f50e1c0e..822b385c 100644 + delete positioner; } - -@@ -441,6 +450,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic - } - setPopup(parent); - m_popup->grab(device, serial); -+ -+ // Synthesize Qt enter/leave events for popup -+ if (!parent) -+ return; -+ QWindow *current = QGuiApplication::topLevelAt(QCursor::pos()); -+ QWindow *leave = parent->window(); -+ if (current != leave) -+ return; -+ -+ QWindowSystemInterface::handleLeaveEvent(leave); -+ -+ QWindow *enter = nullptr; -+ if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window()) -+ enter = m_popup->m_xdgSurface->window()->window(); -+ -+ if (enter) -+ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); - } - - void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) + diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index 96785205..4b518f0a 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -131,14 +131,15 @@ private: - + class Popup : public QtWayland::xdg_popup { public: - Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent, QtWayland::xdg_positioner *positioner); + Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent, QtWayland::xdg_positioner *positioner); ~Popup() override; - + void grab(QWaylandInputDevice *seat, uint serial); void xdg_popup_popup_done() override; - + QWaylandXdgSurface *m_xdgSurface = nullptr; - QWaylandXdgSurface *m_parent = nullptr; + QWaylandXdgSurface *m_parentXdgSurface = nullptr; + QWaylandWindow *m_parent = nullptr; bool m_grabbing = false; }; - + diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration.cpp index 8769d971..da0dd6a7 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration.cpp @@ -2581,7 +2547,7 @@ index 8769d971..da0dd6a7 100644 @@ -69,20 +69,6 @@ QWaylandShellSurface *QWaylandXdgShellIntegration::createShellSurface(QWaylandWi return m_xdgShell->getXdgSurface(window); } - + -void QWaylandXdgShellIntegration::handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) -{ - if (newFocus) { @@ -2597,7 +2563,7 @@ index 8769d971..da0dd6a7 100644 -} - } - + QT_END_NAMESPACE diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h index b6caa6c9..2f929f98 100644 @@ -2608,7 +2574,7 @@ index b6caa6c9..2f929f98 100644 bool initialize(QWaylandDisplay *display) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; - void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) override; - + private: QScopedPointer m_xdgShell; diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp @@ -2638,12 +2604,12 @@ index 1568b3b9..067410d0 100644 --- a/tests/auto/client/datadevicev1/tst_datadevicev1.cpp +++ b/tests/auto/client/datadevicev1/tst_datadevicev1.cpp @@ -35,7 +35,7 @@ - + using namespace MockCompositor; - + -constexpr int dataDeviceVersion = 1; +constexpr int dataDeviceVersion = 3; - + class DataDeviceCompositor : public DefaultCompositor { public: diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp @@ -2656,12 +2622,12 @@ index 9312c2e5..2ea382f1 100644 void tapAndMoveInSameFrame(); + void cancelTouch(); }; - + void tst_seatv5::bindsToSeat() @@ -646,5 +647,34 @@ void tst_seatv5::tapAndMoveInSameFrame() QTRY_COMPARE(window.m_events.last().touchPoints.first().state(), Qt::TouchPointState::TouchPointReleased); } - + +void tst_seatv5::cancelTouch() +{ + TouchWindow window; @@ -2693,35 +2659,23 @@ index 9312c2e5..2ea382f1 100644 + QCOMPOSITOR_TEST_MAIN(tst_seatv5) #include "tst_seatv5.moc" -diff --git a/tests/auto/client/shared/corecompositor.cpp b/tests/auto/client/shared/corecompositor.cpp -index 5c6c83ba..fa9b7662 100644 ---- a/tests/auto/client/shared/corecompositor.cpp -+++ b/tests/auto/client/shared/corecompositor.cpp -@@ -27,6 +27,7 @@ - ****************************************************************************/ - - #include "corecompositor.h" -+#include - - namespace MockCompositor { - diff --git a/tests/auto/client/shared/coreprotocol.cpp b/tests/auto/client/shared/coreprotocol.cpp index 0d988521..53e12291 100644 --- a/tests/auto/client/shared/coreprotocol.cpp +++ b/tests/auto/client/shared/coreprotocol.cpp @@ -185,6 +185,8 @@ void Output::output_bind_resource(QtWaylandServer::wl_output::Resource *resource - + if (m_version >= WL_OUTPUT_DONE_SINCE_VERSION) wl_output::send_done(resource->handle); + + Q_EMIT outputBound(resource); } - + // Seat stuff @@ -451,6 +453,13 @@ void Touch::sendFrame(wl_client *client) send_frame(r->handle); } - + +void Touch::sendCancel(wl_client *client) +{ + const auto touchResources = resourceMap().values(client); @@ -2748,7 +2702,7 @@ index a1af137a..00c439e1 100644 @@ -273,6 +273,9 @@ public: OutputData m_data; int m_version = 1; // TODO: remove on libwayland upgrade - + +Q_SIGNALS: + void outputBound(Resource *resource); + @@ -2760,7 +2714,7 @@ index a1af137a..00c439e1 100644 void sendMotion(wl_client *client, const QPointF &position, int id); void sendFrame(wl_client *client); + void sendCancel(wl_client *client); - + Seat *m_seat = nullptr; }; diff --git a/tests/auto/client/shared_old/mockcompositor.cpp b/tests/auto/client/shared_old/mockcompositor.cpp @@ -2770,12 +2724,12 @@ index a415cbf5..b1d3d07d 100644 @@ -342,7 +342,7 @@ Compositor::Compositor(MockCompositor *mockCompositor) exit(EXIT_FAILURE); } - + - wl_global_create(m_display, &wl_compositor_interface, 1, this, bindCompositor); + wl_global_create(m_display, &wl_compositor_interface, 4, this, bindCompositor); - + m_data_device_manager.reset(new DataDeviceManager(this, m_display)); - + diff --git a/tests/auto/client/shared_old/mocksurface.cpp b/tests/auto/client/shared_old/mocksurface.cpp index e9df5f90..c3246e4a 100644 --- a/tests/auto/client/shared_old/mocksurface.cpp @@ -2783,7 +2737,7 @@ index e9df5f90..c3246e4a 100644 @@ -125,6 +125,16 @@ void Surface::surface_damage(Resource *resource, Q_UNUSED(height); } - + +void Surface::surface_damage_buffer(Resource *resource, + int32_t x, int32_t y, int32_t width, int32_t height) +{ @@ -2820,12 +2774,12 @@ index 80429608..68e8d77a 100644 void changeGeometry(); + void outputCreateEnterRace(); }; - + void tst_xdgoutput::cleanup() @@ -134,5 +135,39 @@ void tst_xdgoutput::changeGeometry() exec([=] { remove(output(1)); }); } - + +void tst_xdgoutput::outputCreateEnterRace() +{ + m_config.autoConfigure = true; @@ -2871,9 +2825,9 @@ index 2277bbb8..747875b4 100644 #include #include +#include - + using namespace MockCompositor; - + @@ -45,6 +46,7 @@ private slots: void configureStates(); void popup(); @@ -2883,7 +2837,7 @@ index 2277bbb8..747875b4 100644 void hidePopupParent(); void pongs(); @@ -138,6 +140,7 @@ void tst_xdgshell::configureSize() - + void tst_xdgshell::configureStates() { + QVERIFY(qputenv("QT_WAYLAND_FRAME_CALLBACK_TIMEOUT", "0")); @@ -2893,7 +2847,7 @@ index 2277bbb8..747875b4 100644 @@ -154,9 +157,12 @@ void tst_xdgshell::configureStates() // Toplevel windows don't know their position on xdg-shell // QCOMPARE(window.frameGeometry().topLeft(), QPoint()); // TODO: this doesn't currently work when window decorations are enabled - + -// QEXPECT_FAIL("", "configure has already been acked, we shouldn't have to wait for isActive", Continue); -// QVERIFY(window.isActive()); - QTRY_VERIFY(window.isActive()); // Just make sure it eventually get's set correctly @@ -2903,7 +2857,7 @@ index 2277bbb8..747875b4 100644 + Q_ASSERT(waylandWindow); + QTRY_VERIFY(waylandWindow->windowStates().testFlag( + Qt::WindowActive)); // Just make sure it eventually get's set correctly - + const QSize screenSize(640, 480); const uint maximizedSerial = exec([=] { @@ -186,6 +192,7 @@ void tst_xdgshell::configureStates() @@ -2912,12 +2866,12 @@ index 2277bbb8..747875b4 100644 // QCOMPARE(window.frameGeometry().topLeft(), QPoint()); // TODO: this doesn't currently work when window decorations are enabled + QVERIFY(qunsetenv("QT_WAYLAND_FRAME_CALLBACK_TIMEOUT")); } - + void tst_xdgshell::popup() @@ -340,6 +347,92 @@ void tst_xdgshell::tooltipOnPopup() QCOMPOSITOR_TRY_COMPARE(xdgPopup(0), nullptr); } - + +void tst_xdgshell::tooltipAndSiblingPopup() +{ + class ToolTip : public QRasterWindow { @@ -3010,9 +2964,9 @@ index 2277bbb8..747875b4 100644 @@ -505,7 +598,7 @@ void tst_xdgshell::minMaxSize() window.show(); QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); - + - exec([=] { xdgToplevel()->sendCompleteConfigure(); }); + // we don't roundtrip with our configuration the initial commit should be correct - + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(100, 100)); QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000)); diff --git a/desktop/toolkit/qt5/qt5-wayland/pspec.xml b/desktop/toolkit/qt5/qt5-wayland/pspec.xml index a24bec9bd2..39cad7a325 100755 --- a/desktop/toolkit/qt5/qt5-wayland/pspec.xml +++ b/desktop/toolkit/qt5/qt5-wayland/pspec.xml @@ -11,7 +11,7 @@ Provides APIs for Wayland Provides APIs for Wayland LGPLv2.1-linking-exception - http://download.qt.io/official_releases/qt/5.15/5.15.9/submodules/qtwayland-everywhere-opensource-src-5.15.9.tar.xz + http://download.qt.io/official_releases/qt/5.15/5.15.10/submodules/qtwayland-everywhere-opensource-src-5.15.10.tar.xz libgcc libX11-devel @@ -28,8 +28,8 @@ mesa-devel glib2-devel freetype-devel - qt5-base-devel - qt5-declarative-devel + qt5-base-devel + qt5-declarative-devel qt_kde.patch @@ -51,8 +51,8 @@ mesa glib2 freetype - qt5-base - qt5-declarative + qt5-base + qt5-declarative /usr/lib @@ -66,7 +66,7 @@ qt5-wayland-devel qt5-wayland - qt5-base-devel + qt5-base-devel /usr/lib/pkgconfig @@ -77,7 +77,7 @@ qt5-wayland-docs - qt5-base + qt5-base /usr/share/doc @@ -85,6 +85,13 @@ + + 2023-06-17 + 5.15.10 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2023-04-10 5.15.9