Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qt6-wayland for openSUSE:Factory checked in at 2024-03-28 13:53:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qt6-wayland (Old) and /work/SRC/openSUSE:Factory/.qt6-wayland.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qt6-wayland" Thu Mar 28 13:53:13 2024 rev:31 rq:1162403 version:6.6.3 Changes: -------- --- /work/SRC/openSUSE:Factory/qt6-wayland/qt6-wayland.changes 2024-02-18 20:24:56.797858478 +0100 +++ /work/SRC/openSUSE:Factory/.qt6-wayland.new.1905/qt6-wayland.changes 2024-03-28 14:09:40.819271182 +0100 @@ -1,0 +2,6 @@ +Tue Mar 26 14:27:07 UTC 2024 - Christophe Marin <[email protected]> + +- Update to 6.6.3: + * https://www.qt.io/blog/qt-6.6.3-released + +------------------------------------------------------------------- Old: ---- qtwayland-everywhere-src-6.6.2.tar.xz New: ---- qtwayland-everywhere-src-6.6.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qt6-wayland.spec ++++++ --- /var/tmp/diff_new_pack.SdlcX4/_old 2024-03-28 14:09:50.503627579 +0100 +++ /var/tmp/diff_new_pack.SdlcX4/_new 2024-03-28 14:09:50.503627579 +0100 @@ -16,7 +16,7 @@ # -%define real_version 6.6.2 +%define real_version 6.6.3 %define short_version 6.6 %define tar_name qtwayland-everywhere-src %define tar_suffix %{nil} @@ -30,7 +30,7 @@ %global with_opengl 1 %endif Name: qt6-wayland%{?pkg_suffix} -Version: 6.6.2 +Version: 6.6.3 Release: 0 Summary: Qt 6 Wayland libraries and tools # The wayland compositor files are GPL-3.0-or-later ++++++ qtwayland-everywhere-src-6.6.2.tar.xz -> qtwayland-everywhere-src-6.6.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/.cmake.conf new/qtwayland-everywhere-src-6.6.3/.cmake.conf --- old/qtwayland-everywhere-src-6.6.2/.cmake.conf 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/.cmake.conf 2024-03-19 00:53:10.000000000 +0100 @@ -1,3 +1,3 @@ -set(QT_REPO_MODULE_VERSION "6.6.2") +set(QT_REPO_MODULE_VERSION "6.6.3") set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/.tag new/qtwayland-everywhere-src-6.6.3/.tag --- old/qtwayland-everywhere-src-6.6.2/.tag 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/.tag 2024-03-19 00:53:10.000000000 +0100 @@ -1 +1 @@ -abc8c8b8ca11f0bddb85f687032426ddd40744fa +c48bc5a760fcf3311998297efb02e5c4bdfde70f diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/dependencies.yaml new/qtwayland-everywhere-src-6.6.3/dependencies.yaml --- old/qtwayland-everywhere-src-6.6.2/dependencies.yaml 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/dependencies.yaml 2024-03-19 00:53:10.000000000 +0100 @@ -1,7 +1,7 @@ dependencies: ../qtbase: - ref: dec1863c7dc63e5788b0c6c061d36e856a6ae2b2 + ref: afdec885058c92e24604f398a926297222da06f3 required: true ../qtdeclarative: - ref: b3d82373ac90e54ad4cbab0c16709a19a9441beb + ref: ab5521fd1a637739c7e91def84caa84426055aff required: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/examples/wayland/overview-compositor/main.qml new/qtwayland-everywhere-src-6.6.3/examples/wayland/overview-compositor/main.qml --- old/qtwayland-everywhere-src-6.6.2/examples/wayland/overview-compositor/main.qml 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/examples/wayland/overview-compositor/main.qml 2024-03-19 00:53:10.000000000 +0100 @@ -5,7 +5,7 @@ import QtWayland.Compositor import QtWayland.Compositor.XdgShell import QtQuick.Window -import QtQuick.Controls 2.0 +import QtQuick.Controls WaylandCompositor { WaylandOutput { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/3rdparty/protocol/qt-toplevel-drag-v1.xml new/qtwayland-everywhere-src-6.6.3/src/3rdparty/protocol/qt-toplevel-drag-v1.xml --- old/qtwayland-everywhere-src-6.6.2/src/3rdparty/protocol/qt-toplevel-drag-v1.xml 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/3rdparty/protocol/qt-toplevel-drag-v1.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<protocol name="qt_toplevel_drag_v1"> - - <copyright> - Copyright 2022 David Redondo <[email protected]> - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice (including the next - paragraph) shall be included in all copies or substantial portions of the - Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - </copyright> - - <interface name="qt_toplevel_drag_manager_v1" version="1"> - <description summary="Move a window during a drag"> - This protocol enhances normal drag and drop with the ability to move a - window at the same time. This allows having detachable windows that - can also be reattached when dragged back to another window or some special - zone. - - Warning! The protocol described in this file is currently in the testing - phase. Backward compatible changes may be added together with the - corresponding interface version bump. Backward incompatible changes can - only be done by creating a new major version of the extension. - </description> - - <request name="get_qt_toplevel_drag"> - <description summary="get an qt_toplevel_drag for a wl_data_source"> - Create an qt_toplevel_drag for a drag and drop operation that is going - to be started with data_source. - This request can only be made on sources used in drag-and-drop, so it - must be performed before wl_data_device.start_drag. Attempting to use - the source other than for drag-and-drop will raise an invalid_source error. - </description> - <arg name="id" type="new_id" interface="qt_toplevel_drag_v1"/> - <arg name="data_source" type="object" interface="wl_data_source"/> - </request> - - <request name="release" type="destructor" /> - - <enum name="error"> - <entry name="invalid_source" value="0" summary="data_source already used for toplevel drag"/> - </enum> - </interface> - - <interface name="qt_toplevel_drag_v1" version="1"> - <description summary="Object representing a toplevel move during a drag"> - </description> - - <request name="attach"> - <description summary="Move a toplevel with the drag operation"> - Request that the window will be moved with the cursor during the drag operation. The offset - describes how the toplevel will be positioned relative to the cursor hotspot - in surface local coordinates. - Issuing this request after the drag has ended will result in a drag_ended protocol error. - </description> - <arg name="toplevel" type="object" interface="xdg_toplevel" /> - <arg name="x_offset" type="int" summary="dragged surface x offset"/> - <arg name="y_offset" type="int" summary="dragged surface y offset"/> - </request> - - <request name="destroy" type="destructor"> - <description summary="destroy an qt_toplevel_drag object" /> - </request> - - <enum name="error"> - <entry name="drag_ended" value="0" summary="corresponding drag has ended" /> - </enum> - </interface> -</protocol> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/3rdparty/protocol/xdg-toplevel-drag-v1.xml new/qtwayland-everywhere-src-6.6.3/src/3rdparty/protocol/xdg-toplevel-drag-v1.xml --- old/qtwayland-everywhere-src-6.6.2/src/3rdparty/protocol/xdg-toplevel-drag-v1.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/3rdparty/protocol/xdg-toplevel-drag-v1.xml 2024-03-19 00:53:10.000000000 +0100 @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<protocol name="xdg_toplevel_drag_v1"> + + <copyright> + Copyright 2023 David Redondo + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + </copyright> + + <interface name="xdg_toplevel_drag_manager_v1" version="1"> + <description summary="Move a window during a drag"> + This protocol enhances normal drag and drop with the ability to move a + window at the same time. This allows having detachable parts of a window + that when dragged out of it become a new window and can be dragged over + an existing window to be reattached. + + A typical workflow would be when the user starts dragging on top of a + detachable part of a window, the client would create a wl_data_source and + a xdg_toplevel_drag_v1 object and start the drag as normal via + wl_data_device.start_drag. Once the client determines that the detachable + window contents should be detached from the originating window, it creates + a new xdg_toplevel with these contents and issues a + xdg_toplevel_drag_v1.attach request before mapping it. From now on the new + window is moved by the compositor during the drag as if the client called + xdg_toplevel.move. + + Dragging an existing window is similar. The client creates a + xdg_toplevel_drag_v1 object and attaches the existing toplevel before + starting the drag. + + Clients use the existing drag and drop mechanism to detect when a window + can be docked or undocked. If the client wants to snap a window into a + parent window it should delete or unmap the dragged top-level. If the + contents should be detached again it attaches a new toplevel as described + above. If a drag operation is cancelled without being dropped, clients + should revert to the previous state, deleting any newly created windows + as appropriate. When a drag operation ends as indicated by + wl_data_source.dnd_drop_performed the dragged toplevel window's final + position is determined as if a xdg_toplevel_move operation ended. + + Warning! The protocol described in this file is currently in the testing + phase. Backward compatible changes may be added together with the + corresponding interface version bump. Backward incompatible changes can + only be done by creating a new major version of the extension. + </description> + + <enum name="error"> + <entry name="invalid_source" value="0" + summary="data_source already used for toplevel drag"/> + </enum> + + <request name="destroy" type="destructor"> + <description summary="destroy the xdg_toplevel_drag_manager_v1 object"> + Destroy this xdg_toplevel_drag_manager_v1 object. Other objects, + including xdg_toplevel_drag_v1 objects created by this factory, are not + affected by this request. + </description> + </request> + + <request name="get_xdg_toplevel_drag"> + <description summary="get an xdg_toplevel_drag for a wl_data_source"> + Create an xdg_toplevel_drag for a drag and drop operation that is going + to be started with data_source. + + This request can only be made on sources used in drag-and-drop, so it + must be performed before wl_data_device.start_drag. Attempting to use + the source other than for drag-and-drop such as in + wl_data_device.set_selection will raise an invalid_source error. + + Destroying data_source while a toplevel is attached to the + xdg_toplevel_drag is undefined. + </description> + + <arg name="id" type="new_id" interface="xdg_toplevel_drag_v1"/> + <arg name="data_source" type="object" interface="wl_data_source"/> + </request> + </interface> + + <interface name="xdg_toplevel_drag_v1" version="1"> + <description summary="Object representing a toplevel move during a drag"> + </description> + + <enum name="error"> + <entry name="toplevel_attached" value="0" + summary="valid toplevel already attached"/> + <entry name="ongoing_drag" value="1" + summary="drag has not ended" /> + </enum> + + <request name="destroy" type="destructor"> + <description summary="destroy an xdg_toplevel_drag_v1 object"> + Destroy this xdg_toplevel_drag_v1 object. This request must only be + called after the underlying wl_data_source drag has ended, as indicated + by the dnd_drop_performed or cancelled events. In any other case an + ongoing_drag error is raised. + </description> + </request> + + <request name="attach"> + <description summary="Move a toplevel with the drag operation"> + Request that the window will be moved with the cursor during the drag + operation. The offset is a hint to the compositor how the toplevel + should be positioned relative to the cursor hotspot in surface local + coordinates. For example it might only be used when an unmapped window + is attached. The attached window does not participate in the selection + of the drag target. + + If the toplevel is unmapped while it is attached, it is automatically + detached from the drag. In this case this request has to be called again + if the window should be attached after it is remapped. + + This request can be called multiple times but issuing it while a + toplevel with an active role is attached raises a toplevel_attached + error. + </description> + + <arg name="toplevel" type="object" interface="xdg_toplevel"/> + <arg name="x_offset" type="int" summary="dragged surface x offset"/> + <arg name="y_offset" type="int" summary="dragged surface y offset"/> + </request> + + </interface> +</protocol> + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/CMakeLists.txt new/qtwayland-everywhere-src-6.6.3/src/client/CMakeLists.txt --- old/qtwayland-everywhere-src-6.6.2/src/client/CMakeLists.txt 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/CMakeLists.txt 2024-03-19 00:53:10.000000000 +0100 @@ -93,8 +93,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-output-unstable-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/fractional-scale-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/viewporter.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/qt-toplevel-drag-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-shell.xml + ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-toplevel-drag-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-key-unstable-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-text-input-method-unstable-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-windowmanager.xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandcursor.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandcursor.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandcursor.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandcursor.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -247,11 +247,11 @@ case Qt::SizeFDiagCursor: return wp_cursor_shape_device_v1::shape_nwse_resize; case Qt::WaitCursor: - return wp_cursor_shape_device_v1::shape_progress; + return wp_cursor_shape_device_v1::shape_wait; case Qt::SizeAllCursor: return wp_cursor_shape_device_v1::shape_all_scroll; case Qt::BusyCursor: - return wp_cursor_shape_device_v1::shape_wait; + return wp_cursor_shape_device_v1::shape_progress; case Qt::SplitVCursor: return wp_cursor_shape_device_v1::shape_row_resize; case Qt::ForbiddenCursor: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddatadevice.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddatadevice.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddatadevice.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddatadevice.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -13,7 +13,7 @@ #include "qwaylandabstractdecoration_p.h" #include "qwaylandsurface_p.h" -#include <QtWaylandClient/private/qwayland-qt-toplevel-drag-v1.h> +#include <QtWaylandClient/private/qwayland-xdg-toplevel-drag-v1.h> #include <QtCore/QMimeData> #include <QtGui/QGuiApplication> @@ -151,8 +151,8 @@ offsetStream >> offset; if (auto waylandWindow = static_cast<QWaylandWindow *>(dockWindow->handle())) { if (auto toplevel = waylandWindow->surfaceRole<xdg_toplevel>()) { - m_toplevelDrag = new QtWayland::qt_toplevel_drag_v1( - m_display->xdgToplevelDragManager()->get_qt_toplevel_drag( + m_toplevelDrag = new QtWayland::xdg_toplevel_drag_v1( + m_display->xdgToplevelDragManager()->get_xdg_toplevel_drag( m_dragSource->object())); m_toplevelDrag->attach(toplevel, offset.x(), offset.y()); } @@ -334,7 +334,8 @@ m_dragOffer->accept(m_enterSerial, m_dragOffer->firstFormat()); } else { - m_dragOffer->accept(m_enterSerial, QString()); + // qtwaylandscanner doesn't support null strings yet (sends empty string), call it directly. + ::wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, nullptr); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddatadevice_p.h new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddatadevice_p.h --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddatadevice_p.h 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddatadevice_p.h 2024-03-19 00:53:10.000000000 +0100 @@ -32,7 +32,7 @@ class QWindow; namespace QtWayland { -class qt_toplevel_drag_v1; +class xdg_toplevel_drag_v1; } namespace QtWaylandClient { @@ -98,7 +98,7 @@ QScopedPointer<QWaylandDataOffer> m_selectionOffer; QScopedPointer<QWaylandDataSource> m_selectionSource; QScopedPointer<QWaylandDataSource> m_dragSource; - QtWayland::qt_toplevel_drag_v1 *m_toplevelDrag = nullptr; + QtWayland::xdg_toplevel_drag_v1 *m_toplevelDrag = nullptr; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddisplay.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddisplay.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddisplay.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddisplay.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -53,7 +53,7 @@ #include <QtWaylandClient/private/qwayland-fractional-scale-v1.h> #include <QtWaylandClient/private/qwayland-viewporter.h> #include <QtWaylandClient/private/qwayland-cursor-shape-v1.h> -#include <QtWaylandClient/private/qwayland-qt-toplevel-drag-v1.h> +#include <QtWaylandClient/private/qwayland-xdg-toplevel-drag-v1.h> #include <QtCore/private/qcore_unix_p.h> @@ -389,6 +389,8 @@ forceRoundTrip(); + emit connected(); + if (!mWaitingScreens.isEmpty()) { // Give wl_output.done and zxdg_output_v1.done events a chance to arrive forceRoundTrip(); @@ -500,8 +502,6 @@ wl_event_queue_destroy(m_frameEventQueue); initEventThread(); - emit reconnected(); - auto needsRecreate = [](QPlatformWindow *window) { return window && !static_cast<QWaylandWindow *>(window)->wlSurface(); }; @@ -762,8 +762,8 @@ } else if (interface == QLatin1String(QtWayland::wp_cursor_shape_manager_v1::interface()->name)) { mCursorShapeManager.reset(new QtWayland::wp_cursor_shape_manager_v1(registry, id, std::min(1u, version))); } else if ( - interface == QLatin1String(QtWayland::qt_toplevel_drag_manager_v1::interface()->name)) { - mXdgToplevelDragManager.reset(new QtWayland::qt_toplevel_drag_manager_v1(registry, id, 1)); + interface == QLatin1String(QtWayland::xdg_toplevel_drag_manager_v1::interface()->name)) { + mXdgToplevelDragManager.reset(new QtWayland::xdg_toplevel_drag_manager_v1(registry, id, 1)); } mGlobals.append(RegistryGlobal(id, interface, version, registry)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddisplay_p.h new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddisplay_p.h --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylanddisplay_p.h 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylanddisplay_p.h 2024-03-19 00:53:10.000000000 +0100 @@ -54,7 +54,7 @@ class wp_cursor_shape_manager_v1; class wp_fractional_scale_manager_v1; class wp_viewporter; - class qt_toplevel_drag_manager_v1; + class xdg_toplevel_drag_manager_v1; } namespace QtWaylandClient { @@ -125,7 +125,10 @@ QWaylandCursor *waylandCursor(); QWaylandCursorTheme *loadCursorTheme(const QString &name, int pixelSize); #endif - struct wl_display *wl_display() const { return mDisplay; } + struct wl_display *wl_display() const + { + return mDisplay; + } struct ::wl_registry *wl_registry() { return object(); } const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } @@ -155,7 +158,7 @@ QtWayland::wp_fractional_scale_manager_v1 *fractionalScaleManager() const { return mFractionalScaleManager.data(); } QtWayland::wp_viewporter *viewporter() const { return mViewporter.data(); } QtWayland::wp_cursor_shape_manager_v1 *cursorShapeManager() const { return mCursorShapeManager.data();} - QtWayland::qt_toplevel_drag_manager_v1 *xdgToplevelDragManager() const { return mXdgToplevelDragManager.data();} + QtWayland::xdg_toplevel_drag_manager_v1 *xdgToplevelDragManager() const { return mXdgToplevelDragManager.data();} struct RegistryGlobal { uint32_t id; @@ -204,7 +207,7 @@ void flushRequests(); signals: - void reconnected(); + void connected(); void globalAdded(const RegistryGlobal &global); void globalRemoved(const RegistryGlobal &global); @@ -226,7 +229,6 @@ RegistryListener listener = nullptr; void *data = nullptr; }; - struct wl_display *mDisplay = nullptr; std::unique_ptr<EventThread> m_eventThread; wl_event_queue *m_frameEventQueue = nullptr; @@ -282,7 +284,7 @@ QScopedPointer<QtWayland::wp_viewporter> mViewporter; QScopedPointer<QtWayland::wp_fractional_scale_manager_v1> mFractionalScaleManager; QScopedPointer<QtWayland::wp_cursor_shape_manager_v1> mCursorShapeManager; - QScopedPointer<QtWayland::qt_toplevel_drag_manager_v1> mXdgToplevelDragManager; + QScopedPointer<QtWayland::xdg_toplevel_drag_manager_v1> mXdgToplevelDragManager; int mFd = -1; int mWritableNotificationFd = -1; QList<RegistryGlobal> mGlobals; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandinputcontext.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandinputcontext.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandinputcontext.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandinputcontext.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -52,20 +52,22 @@ QPlatformInputContext::reset(); - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return; - textInput()->reset(); + inputInterface->reset(); } void QWaylandInputContext::commit() { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return; - textInput()->commit(); + inputInterface->commit(); } static ::wl_surface *surfaceForWindow(QWindow *window) @@ -81,92 +83,100 @@ { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO << queries; - if (!QGuiApplication::focusObject() || !textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!QGuiApplication::focusObject() || !inputInterface) return; auto *currentSurface = surfaceForWindow(mCurrentWindow); if (currentSurface && !inputMethodAccepted()) { - textInput()->disableSurface(currentSurface); + inputInterface->disableSurface(currentSurface); mCurrentWindow.clear(); } else if (!currentSurface && inputMethodAccepted()) { QWindow *window = QGuiApplication::focusWindow(); if (auto *focusSurface = surfaceForWindow(window)) { - textInput()->enableSurface(focusSurface); + inputInterface->enableSurface(focusSurface); mCurrentWindow = window; } } - textInput()->updateState(queries, QWaylandTextInputInterface::update_state_change); + inputInterface->updateState(queries, QWaylandTextInputInterface::update_state_change); } void QWaylandInputContext::invokeAction(QInputMethod::Action action, int cursorPostion) { - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return; if (action == QInputMethod::Click) - textInput()->setCursorInsidePreedit(cursorPostion); + inputInterface->setCursorInsidePreedit(cursorPostion); } void QWaylandInputContext::showInputPanel() { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return; - textInput()->showInputPanel(); + inputInterface->showInputPanel(); } void QWaylandInputContext::hideInputPanel() { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return; - textInput()->hideInputPanel(); + inputInterface->hideInputPanel(); } bool QWaylandInputContext::isInputPanelVisible() const { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return QPlatformInputContext::isInputPanelVisible(); - return textInput()->isInputPanelVisible(); + return inputInterface->isInputPanelVisible(); } QRectF QWaylandInputContext::keyboardRect() const { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return QPlatformInputContext::keyboardRect(); - return textInput()->keyboardRect(); + return inputInterface->keyboardRect(); } QLocale QWaylandInputContext::locale() const { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return QPlatformInputContext::locale(); - return textInput()->locale(); + return inputInterface->locale(); } Qt::LayoutDirection QWaylandInputContext::inputDirection() const { qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO; - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return QPlatformInputContext::inputDirection(); - return textInput()->inputDirection(); + return inputInterface->inputDirection(); } void QWaylandInputContext::setFocusObject(QObject *object) @@ -178,7 +188,8 @@ Q_UNUSED(object); #endif - if (!textInput()) + QWaylandTextInputInterface *inputInterface = textInput(); + if (!inputInterface) return; QWindow *window = QGuiApplication::focusWindow(); @@ -187,7 +198,7 @@ if (mCurrentWindow.data() != window || !inputMethodAccepted()) { auto *surface = static_cast<QWaylandWindow *>(mCurrentWindow->handle())->wlSurface(); if (surface) - textInput()->disableSurface(surface); + inputInterface->disableSurface(surface); mCurrentWindow.clear(); } } @@ -196,11 +207,11 @@ if (mCurrentWindow.data() != window) { auto *surface = static_cast<QWaylandWindow *>(window->handle())->wlSurface(); if (surface) { - textInput()->enableSurface(surface); + inputInterface->enableSurface(surface); mCurrentWindow = window; } } - textInput()->updateState(Qt::ImQueryAll, QWaylandTextInputInterface::update_state_enter); + inputInterface->updateState(Qt::ImQueryAll, QWaylandTextInputInterface::update_state_enter); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandinputdevice.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandinputdevice.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandinputdevice.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandinputdevice.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -1335,8 +1335,7 @@ auto code = key + 8; // map to wl_keyboard::keymap_format::keymap_format_xkb_v1 xkb_keysym_t sym = xkb_state_key_get_one_sym(mXkbState.get(), code); - - Qt::KeyboardModifiers modifiers = mParent->modifiers(); + Qt::KeyboardModifiers modifiers = QXkbCommon::modifiers(mXkbState.get(), sym); int qtkey = keysymToQtKey(sym, modifiers, mXkbState.get(), code); QString text = QXkbCommon::lookupString(mXkbState.get(), code); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandinputmethodcontext.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandinputmethodcontext.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandinputmethodcontext.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandinputmethodcontext.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -361,6 +361,9 @@ if (inputMethod == nullptr) return; + if (inputMethod->isVisible() && !inputMethodAccepted()) + inputMethod->hide_input_panel(); + QWindow *window = QGuiApplication::focusWindow(); if (m_currentWindow != nullptr && m_currentWindow->handle() != nullptr) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandshmbackingstore.cpp new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandshmbackingstore.cpp --- old/qtwayland-everywhere-src-6.6.2/src/client/qwaylandshmbackingstore.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/client/qwaylandshmbackingstore.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -136,7 +136,7 @@ : QPlatformBackingStore(window) , mDisplay(display) { - QObject::connect(mDisplay, &QWaylandDisplay::reconnected, window, [this]() { + QObject::connect(mDisplay, &QWaylandDisplay::connected, window, [this]() { auto copy = mBuffers; // clear available buffers so we create new ones // actual deletion is deferred till after resize call so we can copy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/compositor/compositor_api/qwaylandcompositor.cpp new/qtwayland-everywhere-src-6.6.3/src/compositor/compositor_api/qwaylandcompositor.cpp --- old/qtwayland-everywhere-src-6.6.2/src/compositor/compositor_api/qwaylandcompositor.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/compositor/compositor_api/qwaylandcompositor.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -41,6 +41,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QStringList> #include <QtCore/QSocketNotifier> +#include <QStandardPaths> #include <QtGui/QDesktopServices> #include <QtGui/QScreen> @@ -137,6 +138,9 @@ QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) { + // Create XDG_RUNTIME_DIR, if it does not already exist + QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); + if (QGuiApplication::platformNativeInterface()) display = static_cast<wl_display*>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/compositor/doc/src/qtwaylandcompositor-overview.qdoc new/qtwayland-everywhere-src-6.6.3/src/compositor/doc/src/qtwaylandcompositor-overview.qdoc --- old/qtwayland-everywhere-src-6.6.2/src/compositor/doc/src/qtwaylandcompositor-overview.qdoc 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/compositor/doc/src/qtwaylandcompositor-overview.qdoc 2024-03-19 00:53:10.000000000 +0100 @@ -153,7 +153,7 @@ In addition, Qt Wayland Compositor is available under the \l{GNU General Public License, version 3}, while the Qt Wayland integration plugin is available under the - \l{GNU General Public License, version 3} or the + \l{GNU Lesser General Public License, version 3} or the \l{GNU General Public License, version 2}. See \l{Qt Licensing} for further details. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/compositor/doc/src/qtwaylandcompositor-qmltypes.qdoc new/qtwayland-everywhere-src-6.6.3/src/compositor/doc/src/qtwaylandcompositor-qmltypes.qdoc --- old/qtwayland-everywhere-src-6.6.2/src/compositor/doc/src/qtwaylandcompositor-qmltypes.qdoc 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/compositor/doc/src/qtwaylandcompositor-qmltypes.qdoc 2024-03-19 00:53:10.000000000 +0100 @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \qmlmodule QtWayland.Compositor 1.\QtMinorVersion + \qmlmodule QtWayland.Compositor \title Qt Wayland Compositor QML Types \ingroup qmlmodules \brief Provides QML types for writing custom Wayland display servers. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp new/qtwayland-everywhere-src-6.6.3/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp --- old/qtwayland-everywhere-src-6.6.2/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -92,6 +92,13 @@ break; } } + + // On desktop NVIDIA resizing QtQuick freezes them when using threaded rendering QTBUG-95817 + // In order to support threaded rendering on embedded platforms where resizing is not needed + // we check if XDG_CURRENT_DESKTOP is set which desktop environments should set + if (qstrcmp(vendor, "NVIDIA") == 0 && qEnvironmentVariableIsSet("XDG_CURRENT_DESKTOP")) { + m_supportsThreading = false; + } } bool QWaylandEglClientBufferIntegration::isValid() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp new/qtwayland-everywhere-src-6.6.3/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp --- old/qtwayland-everywhere-src-6.6.2/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -24,7 +24,7 @@ , m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration())) , m_format(window->requestedFormat()) { - connect(display, &QWaylandDisplay::reconnected, this, [this] { + connect(display, &QWaylandDisplay::connected, this, [this] { m_clientBufferIntegration = static_cast<QWaylandEglClientBufferIntegration *>( mDisplay->clientBufferIntegration()); }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp new/qtwayland-everywhere-src-6.6.3/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp --- old/qtwayland-everywhere-src-6.6.2/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -195,7 +195,7 @@ const QSurfaceFormat &fmt, QPlatformOpenGLContext *share) : QEGLPlatformContext(fmt, share, eglDisplay), m_display(display) { - m_reconnectionWatcher = QObject::connect(m_display, &QWaylandDisplay::reconnected, [this]() { + m_reconnectionWatcher = QObject::connect(m_display, &QWaylandDisplay::connected, [this]() { invalidateContext(); }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp new/qtwayland-everywhere-src-6.6.3/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp --- old/qtwayland-everywhere-src-6.6.2/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -416,15 +416,16 @@ const int minHeight = qMax(0, minSize.height()); int maxWidth = qMax(0, maxSize.width()); int maxHeight = qMax(0, maxSize.height()); - if (maxWidth == QWINDOWSIZE_MAX) - maxWidth = 0; - if (maxHeight == QWINDOWSIZE_MAX) - maxHeight = 0; // It will not change min/max sizes if invalid. if (minWidth > maxWidth || minHeight > maxHeight) return; + if (maxWidth == QWINDOWSIZE_MAX) + maxWidth = 0; + if (maxHeight == QWINDOWSIZE_MAX) + maxHeight = 0; + m_toplevel->set_min_size(minWidth, minHeight); m_toplevel->set_max_size(maxWidth, maxHeight); } @@ -632,17 +633,20 @@ // focus stealing prevention indication, so requestXdgActivationToken call // is still necessary in that case. const auto wlWindow = focusWindow ? static_cast<QWaylandWindow*>(focusWindow->handle()) : m_window; - if (const auto xdgSurface = qobject_cast<QWaylandXdgSurface *>(wlWindow->shellSurface())) { - if (const auto seat = wlWindow->display()->lastInputDevice()) { - const auto tokenProvider = activation->requestXdgActivationToken( - wlWindow->display(), wlWindow->wlSurface(), seat->serial(), xdgSurface->m_appId); - connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this, - [this, tokenProvider](const QString &token) { - m_shell->activation()->activate(token, window()->wlSurface()); - tokenProvider->deleteLater(); - }); - return true; - } + + QString appId; + if (const auto xdgSurface = qobject_cast<QWaylandXdgSurface *>(wlWindow->shellSurface())) + appId = xdgSurface->m_appId; + + if (const auto seat = wlWindow->display()->lastInputDevice()) { + const auto tokenProvider = activation->requestXdgActivationToken( + wlWindow->display(), wlWindow->wlSurface(), seat->serial(), appId); + connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this, + [this, tokenProvider](const QString &token) { + m_shell->activation()->activate(token, window()->wlSurface()); + tokenProvider->deleteLater(); + }); + return true; } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/tests/auto/client/cursor/tst_cursor.cpp new/qtwayland-everywhere-src-6.6.3/tests/auto/client/cursor/tst_cursor.cpp --- old/qtwayland-everywhere-src-6.6.2/tests/auto/client/cursor/tst_cursor.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/tests/auto/client/cursor/tst_cursor.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -65,7 +65,7 @@ QCOMPARE(setCursorShapeSpy.takeFirst().at(0).toUInt(), enterSerial); // client sets a different shape - window.setCursor(QCursor(Qt::BusyCursor)); + window.setCursor(QCursor(Qt::WaitCursor)); QVERIFY(setCursorShapeSpy.wait()); QCOMPOSITOR_COMPARE(cursorShape()->m_currentShape, CursorShapeDevice::shape_wait); @@ -88,7 +88,7 @@ // set a shape again window.setCursor(QCursor(Qt::BusyCursor)); QVERIFY(setCursorShapeSpy.wait()); - QCOMPOSITOR_COMPARE(cursorShape()->m_currentShape, CursorShapeDevice::shape_wait); + QCOMPOSITOR_COMPARE(cursorShape()->m_currentShape, CursorShapeDevice::shape_progress); setCursorShapeSpy.clear(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwayland-everywhere-src-6.6.2/tests/auto/client/xdgshell/tst_xdgshell.cpp new/qtwayland-everywhere-src-6.6.3/tests/auto/client/xdgshell/tst_xdgshell.cpp --- old/qtwayland-everywhere-src-6.6.2/tests/auto/client/xdgshell/tst_xdgshell.cpp 2024-02-09 23:03:05.000000000 +0100 +++ new/qtwayland-everywhere-src-6.6.3/tests/auto/client/xdgshell/tst_xdgshell.cpp 2024-03-19 00:53:10.000000000 +0100 @@ -26,6 +26,7 @@ void switchPopups(); void hidePopupParent(); void pongs(); + void minMaxSize_data(); void minMaxSize(); void windowGeometry(); void foreignSurface(); @@ -606,12 +607,47 @@ QCOMPARE(pongSpy.first().at(0).toUInt(), serial); } +void tst_xdgshell::minMaxSize_data() +{ + QTest::addColumn<QSize>("initialMinSize"); + QTest::addColumn<QSize>("initialMaxSize"); + QTest::addColumn<QSize>("nextMinSize"); + QTest::addColumn<QSize>("nextMaxSize"); + QTest::addColumn<QSize>("expectedInitialMinSize"); + QTest::addColumn<QSize>("expectedInitialMaxSize"); + QTest::addColumn<QSize>("expectedNextMinSize"); + QTest::addColumn<QSize>("expectedNextMaxSize"); + + QTest::newRow("onlyMinSize") << QSize(50, 60) << QSize() << QSize(500, 600) << QSize() + << QSize(50, 60) << QSize(0, 0) << QSize(500, 600) << QSize(0, 0); + + QTest::newRow("onlyMaxSize") << QSize() << QSize(70, 80) << QSize() << QSize(700, 800) + << QSize(0,0 ) << QSize(70, 80) << QSize(0, 0) << QSize(700, 800); + + QTest::newRow("maxIsSentAsZero") << QSize() << QSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX) << QSize() << QSize() + << QSize(0,0 ) << QSize(0, 0) << QSize(0, 0) << QSize(0, 0); + + + QTest::newRow("fullHints") << QSize(50, 60) << QSize(700, 800) << QSize(500, 600) << QSize(710, 810) + << QSize(50, 60) << QSize(700, 800) << QSize(500, 600) << QSize(710, 810); + + // setting a minimum above the maximum is not allowed, we should no-op + QTest::newRow("invalidResize") << QSize(50, 60) << QSize(100, 100) << QSize(500, 600) << QSize(100, 100) + << QSize(50, 60) << QSize(100, 100) << QSize(50, 60) << QSize(100, 100);} + void tst_xdgshell::minMaxSize() { + QFETCH(QSize, initialMinSize); + QFETCH(QSize, initialMaxSize); + + QFETCH(QSize, expectedInitialMinSize); + QFETCH(QSize, expectedInitialMaxSize); + QRasterWindow window; - window.setMinimumSize(QSize(100, 100)); - window.setMaximumSize(QSize(1000, 1000)); - window.resize(400, 320); + if (initialMinSize.isValid()) + window.setMinimumSize(initialMinSize); + if (initialMaxSize.isValid()) + window.setMaximumSize(initialMaxSize); window.show(); QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); @@ -619,16 +655,21 @@ // 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)); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, expectedInitialMinSize); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, expectedInitialMaxSize); - window.setMaximumSize(QSize(500, 400)); + QFETCH(QSize, nextMinSize); + QFETCH(QSize, expectedNextMinSize); + window.setMinimumSize(nextMinSize); window.update(); - QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(500, 400)); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, expectedNextMinSize); + + QFETCH(QSize, nextMaxSize); + QFETCH(QSize, expectedNextMaxSize); - window.setMinimumSize(QSize(50, 40)); + window.setMaximumSize(nextMaxSize); window.update(); - QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(50, 40)); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, expectedNextMaxSize); } void tst_xdgshell::windowGeometry()
