summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Client: Fix the mouse being stuck in pressed state after DnDIlya Fedin2023-03-211-1/+1
| | | | | | | | | | | | | | I can still reproduce the problem using QtWidgets applications on KDE Plasma 5.27. Both Windows and macOS QPA have a similar quirk and they both send a MouseButtonRelease event rather than a MouseMove event. Amends f7a386eeaec8e6314c1be7de5e14e9fe3847f9ba Task-number: QTBUG-97037 Pick-to: 6.5 6.2 5.15 Change-Id: I864a1cb68b3660d858623f943b3958f7cafbf955 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Fix wl_surface destruction orderVlad Zahorodnii2023-03-201-6/+6
| | | | | | | | | | | | | | The main thread can attempt to close the window while the QtQuick render thread is still busy. If that happens, ensure that QtQuick render thread has finished rendering and presented the last frame before destroying the wp_viewport and any other associated surface extensions so the window destruction looks more reasonable. Pick-to: 6.5 Change-Id: I8d2a3372fe6de51f357eed513baaa34a148470e3 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Forward active focus to clients immediatelyBernd Weimer2023-03-162-2/+13
| | | | | | | | | The acitve focus has only been set in clients when a key was pressed. This caused Qt clients to miss the pressed key event. Fixes: QTBUG-108645 Change-Id: Ie277d64e4e707533d84179c01a69a745cb4da950 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Add support for xdg_popup_configureLiang Qi2023-03-102-0/+29
| | | | | | | | | | | | | | | | | This amends 59a5fe99e1569421b920d99c5b20cdafcdcf43a9. Since set_constraint_adjustment() was supported, popup should reposition itself from configure. Need to find a way to test clientSideMargins() and etc in the future. Fixes: QTBUG-110623 Task-number: QTBUG-87303 Pick-to: 5.15 6.2 6.4 6.5 Done-with: Ilya Fedin <fedin-ilja2010@ya.ru> Change-Id: I734acfcde3ba5a35b6f4222358bc93e49fa43f7c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-0711-21/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an optional mechanism for clients to survive a crash and reconnect seemingly seamlessly. In the event of a disconnect from the compositor socket we simply try to reconnect again and replay any data needed so that we maintain a consistent state to where we left off. From an application point-of-view any open popups will be dismissed and we we potentially get a new framecallback, but it will be almost entirely transparent. Users of custom QWaylandClientExtensions will be notified via the activeChanged signal and rebuild as though the compositor had withdrawn and re-announced the global. OpenGL contexts will be marked as invalid, and handled the same way as a GPU reset. On the next frame RHI will notice these are invalid and recreate them, only now against a new wl_display and new EGLDisplay. Users of low level EGL/native objects might be affected, but the alternative at this point is being closed anyway. The entire codepath is only activated via an environment variable. Change-Id: I6c4acc885540e14cead7640794df86dd974fef4f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Do not cast placeholder screens to QWaylandScreenAleix Pol2023-03-061-1/+1
| | | | | | | | | | It's wrong to C-cast an object to a class that isn't theirs. Check if it is a placeholder first. Pick-to: 5.15 6.2 6.5 Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Rename pure-qml to fancy-compositorEskil Abrahamsen Blomfeldt2023-03-061-3/+3
| | | | | | | | | | | | | | | The pure-qml name made sense when the example was made, but since then we have added a lot of examples that are all in Pure QML. Minimal QML covers the basics of how to set up a compositor in QML, but Pure QML shows a more advanced use case, with animations, windowing system features, virtual keyboard support, etc. To make it clear what the example is demonstrating, we call it Fancy Compositor instead. Task-number: QTBUG-110993 Change-Id: Iad1cfb11b6461858ebcdaa388ed16e1fd3ec8805 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Suppress QSharedMemory deprecation warningsMårten Nordheim2023-03-022-3/+5
| | | | | | | | | | | Since some consumers/producers may be using the old API we will use that and suppress the warnings. Reverts 904b9d33dc0ac97b01c811f0bcb8f67f824b052b Change-Id: Ia59fcb241ca991b8f096a07de4946c49f7997d72 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Client: Allow runtime disabling of interfaces for debugging purposesDavid Edmundson2023-03-021-0/+5
| | | | | | | | | | | | | | When running it's useful to confirm things work correctly in various configurations. In particular testing how things behave without server side decorations is important on all changes. It's easier to make the client pretend the compositor didn't send anything than change the compositor every time. This also potentially makes unit tests simpler than having to change the mock compositor setup. Change-Id: Ide897d918384389009aa38c7030d5ac30fc837a6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Cleanup CSD contentFBO on surface hideDavid Edmundson2023-03-021-0/+2
| | | | | | | | | | | Otherwise we're wasting a large amount of memory. It will be recreated on the next show. This is also needed for handling compositor reset support where the framebuffer needs recreating. Change-Id: Ia684266f6f7998b0d62d177faf182efdfeaa0f06 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Port xdg shell plugin towards QWaylandShellIntegrationTemplateDavid Redondo2023-03-014-38/+46
| | | | | | | | | | | Ports manual initialization to the automatic handling of the template. For now the integration QWaylandXdgShellIntegration and QWaylandXdgShell are still separate but could be merged in a future step. Change-Id: I73bb9674e62f24f403349784e1b1e52a39aa8e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Port ivishell integration to QWaylandShellIntegrationTemplateDavid Redondo2023-03-012-19/+20
| | | | | | | | Use ivi_application as the principal global and use QWaylandClientExtensionTemplate to manage ivi_controller. Change-Id: I172c14d3b79e875842459c36e4e191ed5287eadc Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Port wlshell integration to QWaylandShellIntegrationTemplateDavid Redondo2023-03-012-21/+6
| | | | | Change-Id: Ib05a4645f930f41819447f6e1d562753a36e5710 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Port fullscreenshell integration to QWaylandShellIntegrationTemplateDavid Redondo2023-03-012-20/+14
| | | | | Change-Id: Ia3271a312d857d7e864444ad77e8e18a4a3858bf Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Unify margins handlingIlya Fedin2023-02-283-38/+24
| | | | | | | | | | | | | | | | | | | | | | Currently all the shell integrations except of xdg-shell pass full surface size to resizeFromApplyConfigure. xdg-shell behavior is not even consistent between the first and the consequent calls to resizeFromApplyConfigure. This replaces QWaylandWindow::customMargins with QWaylandWindow::windowContentMargins in order to being able to retrieve set_window_geometry margins separately from the geometry itself and makes xdg-shell passing the geometry consistently as full surface size removing the need in special casing. This also makes QWaylandWindow::clientSizeMargins public so e.g. xdg-shell can compute out absolute position for window content geometry without special casing decorations Pick-to: 6.5 Change-Id: I1b98afc8b5c867ecb7cc586267b13f7ec4b1a88c Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Remove flip popup constraintsVlad Zahorodnii2023-02-281-3/+1
| | | | | | | | | | | | | | | | xdg_positioner doesn't have good anchor rect and other needed information so the compositor can properly flip popups. In some windows I see that some popups are flipped in such a way that the popups look "detached" from the parent window. With the information that QtWayland provides so far only slide constraint adjustments can produce somewhat expected results. Although there will be still some issues near screen edges. Pick-to: 6.5 6.4 6.2 5.15 Task-number: QTBUG-87303 Change-Id: I4021f497b78e62651fe606c4be21a387a92edd6c Reviewed-by: Liang Qi <liang.qi@qt.io>
* Client: Update last input device on tablet tool tapVlad Zahorodnii2023-02-283-4/+17
| | | | | | | | | | | | When user uses tablet exclusively to navigate in an app, the last tracked input device will be null. As the result, any popup that requires a popup grab will be backed by an xdg-toplevel rather than an xdg-popup. Fixes: QTBUG-111130 Change-Id: Ib87e732603bbe111c584361357727171825f8c68 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* doc: Remove category from examples docsEskil Abrahamsen Blomfeldt2023-02-288-14/+12
| | | | | | | | | | | | | | Remove redundant categorization from example title as according to example guidelines. The examples are already categorized under Qt Wayland Compositor Examples, so adding it to the title makes the list a bit cluttered. Pick-to: 6.5 Task-number: QTBUG-110993 Change-Id: I91ad127611c7b1e4d8c558377bc5f46e0ec28a41 Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* client: Utilize new handleWindowDevicePixelRatioChangedDavid Edmundson2023-02-271-1/+7
| | | | | | | | | | | | | Rather than assuming window scale should match the screen scale use an explicit notification system. This fixes issues caused by drift between the two: Task-number: QTBUG-101656 Task-number: QTBUG-93380 Change-Id: I9edb5fd95b8ceeca8073db1f56d81a31bbc9c549 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* client: Force a roundtrip when an XdgOutput is not ready yetMarco Martin2023-02-271-0/+2
| | | | | | | | | | | | Is possible that the server sends a surface_enter before all the information of the XdgOutput have been processed by the client. in this case the associated QScreen doesn't exist yet, causing a QWindow::SetScreen(nullptr), which will fall back to QGuiApplication::primaryScreen(), having the QWindow being assigned the wrong screen Change-Id: I923d5d3a35484deafa6f0572f79c16c27b1f87f0 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Move setup functions from local to memberThomas Senyk2023-02-272-5/+7
| | | | | | | | | | | | | | Two functions with the same name and signiture were committed in two files. Normally this isn't an issue as those symbols end up in different plugins, however for a static Qt build all are linked into the same binary => symbol clash! Changing those functions to member functions of the respective private classes resolves this issue. As the original name was rather long, it was also shorted in the process. Fixes: QTBUG-111473 Pick-to: 6.5 Change-Id: I0f341a64199637a415898309763f9b5416fc4be1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix build on CentOS 7Ilya Fedin2023-02-241-0/+10
| | | | | | | | | | | | | | | | | | Have the following errors while attempting to build qtwayland v6.5.0-beta3: /usr/src/Libraries/qt_6.5.0/qtwayland/src/client/qwaylandshmbackingstore.cpp:48:19: error: 'F_ADD_SEALS' was not declared in this scope 48 | fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); | ^~~~~~~~~~~ /usr/src/Libraries/qt_6.5.0/qtwayland/src/client/qwaylandshmbackingstore.cpp:48:32: error: 'F_SEAL_SHRINK' was not declared in this scope 48 | fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); | ^~~~~~~~~~~~~ /usr/src/Libraries/qt_6.5.0/qtwayland/src/client/qwaylandshmbackingstore.cpp:48:48: error: 'F_SEAL_SEAL' was not declared in this scope 48 | fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); | ^~~~~~~~~~~ Pick-to: 6.5 Change-Id: I4b9b3a13ac47483594f454ba36dc5d720cb592a5 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Stop requesting activation on every focus object changeVlad Zahorodnii2023-02-221-13/+0
| | | | | | | | | | | | | | | | | | | | | | Currently, windows with xdg-toplevel surface role request window activation every time the focus object changes. It conflicts with the compositor's activation and stacking order policies. For example, when a window is minimized, the compositor will start an animation and move focus to the next window. If that window activates itself, it can be raised in the stack and start covering the minimized window, thus making it look as if no animation is played at all. This activation logic was introduced as part of qt-shell activation model in d89c8920f3b82dd2098971b5a66c4b9c75da5af0. On the other hand, with the introduction of the xdg-activation-v1 protocol, there is a better way to pass input focus, so drop the qt-shell hack in favor of that. Fixes: QTBUG-111377 Pick-to: 6.5 Change-Id: I8ed19f1be17f49fa9748b1cb5fdd0070791d2ecd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Convert cursor bitmap to supported formatMichael Weghorn2023-02-221-1/+15
| | | | | | | | | | | | | The 1-bit image formats QImage::Format_Mono and QImage::Format_MonoLSB used by cursor bitmaps don't have a corresponding wl_shm_format. Therefore, convert to a supported image format as necessary to make such bitmap cursors work on Wayland as well. Fixes: QTBUG-95434 Change-Id: I402fd870b301ddc01075251b66f2cf7cc1923133 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix automoc warning regarding includeMårten Nordheim2023-02-211-1/+1
| | | | | | | | | | | There's no Q_OBJECT etc. in the .cpp file, so likely it was removed, or it was intended to include the moc file for the sake of the header. But moc-file for the header has another naming scheme. Pick-to: 6.5 Change-Id: If1202537a40d746e263fd6e6f67e316a2cdb109e Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QOpenGLContext re-creation - orphanedTexturesThomas Senyk2023-02-206-13/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The texture clean-up in the HW-integration has two issues when QOpenGLContext is re-created. 1. texture going out-of-date (QOpenGLContext::aboutToBeDestroyed) and still being used/returned to be used 2. QOpenGLContext dies (QOpenGLContext::aboutToBeDestroyed) while an "discarded" QOpenGLTexture (an orphan) isn't deleted yet. (you can't delete a texture past it's ctx's QOpenGLContext::aboutToBeDestroyed) This patch fixes both issues with a helper and a lambda on 3 HW-integration-backends: wayland-egl, wayland-eglstream and linux-dmabuf Fix for 1.: Simple connection to a lambda that deletes the texture and removes them from the set of used textures. Signal is QOpenGLContext::aboutToBeDestroyed Fix for 2.: A function in each backend: deleteSpecificOrphanedTexture(QOpenGLTexture *texture) Also connected/called by QOpenGLContext::aboutToBeDestroyed Deletes the texture (before deleteOrphanedTextures() does it too late) and removes the dead pointer from the orphanage Pick-to: 6.5 Change-Id: Iccce8845bb669df93f1be43cbe9b9d25f7fd5235 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Disambiguate Vulkan debug constantsFriedemann Kleint2023-02-133-34/+34
| | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I4dfef40309a42b8fa662dfa3d99b65d920480aba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Exclude sources generated by the scanner from CMake Unity (Jumbo) buildsFriedemann Kleint2023-02-131-4/+6
| | | | | | | | | The generated helper function wlRegistryBind() clashes. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ib814d4576c7565b0413ca16bc0bf5e95caa92c33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove QWindow forward declarations in namespacesFriedemann Kleint2023-02-132-2/+0
| | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Idc0d0baeef4b92f61ed67d9a850b5ad3422f9146 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Disambiguate input method constantsFriedemann Kleint2023-02-133-8/+8
| | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I13b33c894818d8aebce763eaf6c961d806961a63 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Disambiguate static variablesFriedemann Kleint2023-02-138-24/+24
| | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ia6e293fa30d788f8abd52bf675f11d7d0151259f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Fix documentation warningsTopi Reinio2023-02-071-1/+1
| | | | | | | | | | | * Wiggly example has been removed. * Remove broken link to 'macros' from QWaylandQuickExtension header reference as unnecessary. Pick-to: 6.5 Change-Id: I17c9db09e7d0a649ab3a37ed867d4f81e039d485 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Do not use deprecated QSharedMemory constructorFabian Kosmale2023-02-011-1/+1
| | | | | | Change-Id: Ic2c2ee4256aa16ebfeb51b3c2f7a3430d4104091 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* compositor: Fix crash when raising shell surface itemEskil Abrahamsen Blomfeldt2023-01-301-4/+7
| | | | | | | | | | | | | | | | This was introduced by d89c8920f3b82dd2098971b5a66c4b9c75da5af0. The raise() function would search for a suitable surface, but failing to find one, it would search past the end of the childItems list and cause memory corruption. [ChangeLog][QtWaylandCompositor] Fixed an issue where the compositor would sometimes crash if a shell surface item was brought to front. Pick-to: 6.4 6.5 Fixes: QTBUG-109051 Change-Id: I2249f0881b90fc05b5f0292cd35c6524db4663c5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* client: Fix infinite recursion with text-input-v2Eskil Abrahamsen Blomfeldt2023-01-301-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was possible to get into an infinite recursion when double-clicking an entry in an item view to edit it. What would happen is that the editor takes focus, and we call commit on the input method commit in case the previous focused widget has pending input that needs to be committed. The subsequent method event then causes the QAbstractItemView to set focus, and since we have not yet updated the focus in the previous call, we end up in an infinite recursion, eventually crashing when the stack overflows. As a guard for this, we only send an input method event when there is actually pre-edit text to commit, and we reset the pre-edit text immediately so that any subsequent call will just exit. [ChangeLog][QtWaylandClient] Fixed a possible crash when editing a field in an item view. Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-109302 Change-Id: I45237c80e53b1386705279899e19319180d78fa1 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Inho Lee <inho.lee@qt.io>
* Don't change process locale while initializing QWaylandInputContextIlya Fedin2023-01-261-3/+1
| | | | | | | | | | This was overriding the locale previously set in QCoreApplicationPrivate::initLocale and can switch the process to non-UTF8 codepage Pick-to: 6.5 6.4 6.2 Change-Id: I5cd6664d1a7c315019d6c798b33b9deb33982a59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* client: Attempt to request activate even if there's no focus windowIlya Fedin2023-01-251-2/+6
| | | | | | | | | The compositor is likely to display some indication even if the activation fails, so it's helpful to always do the request. Pick-to: 6.5 6.4 Change-Id: Ia3a8075e471d5a4b619f420ee166e7146f1229b8 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* QWaylandTabletSeatV2: Do not leak tablet informationAleix Pol2023-01-241-0/+3
| | | | | | | | Clean up after the information we allocated, this way address sanitizer doesn't complain about it leaking. Change-Id: Ib7ade93d6585b8c6be6a71d0497801d9cfe75d2f Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandDataOffer: Save double look-upAleix Pol2023-01-241-2/+3
| | | | | | | Only look up the value on the QHash once. Change-Id: I7c7c2f72bb1aa8fad0d374d5ea84c093ea5a2f01 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Manage QMimeData lifecycleTang Haixiang2023-01-094-13/+22
| | | | | | | | | | | | QMimeData is created by user, it is not taken care of in qtwayland, which will cause memory leak. It is now handled in qtwayland that when a new QMimeData is set, the previous QMimeData is freed. Change-Id: Ic502021fe700c7ee10454d94f0d1868901809af7 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Client: Fix handling of Qt::BlankCursorVlad Zahorodnii2023-01-051-2/+1
| | | | | | | | | | | | | | The cursor may not be properly set when a window has Qt::BlankCursor and it's shown. In that case, the cursor surface may not be present and wl_pointer.set_cursor won't be called. On the other hand, wl_pointer.set_cursor must be always called when wl_pointer.enter is received. Pick-to: 6.5 Change-Id: I8540e7a02df1579b3380a1a1d4cfab42c1ab3104 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Client: Port to QPlatformTheme::{MouseCursorTheme,MouseCursorSize}Vlad Zahorodnii2023-01-032-18/+17
| | | | | | | | | | It allows the platform theme to specify the preferred cursor theme and cursor size without resorting to hacks such as setting XCURSOR_THEME and XCURSOR_SIZE environment variables. Pick-to: 6.5 Change-Id: I9e44f9c6dddbb5d730f8ac092f2c11fdbccf8d27 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add WL_SHM_FORMAT_RGB888 to supported shm formatsThomas Senyk2022-12-132-1/+9
| | | | | | | | | | In addition a new entry in QWaylandCompositor::ShmFormat allows compositors to enable that format at runtime Pick-to: 6.5 Change-Id: I0f894adb3f688458a65713e343127fbcb26f8b65 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Client: Handle zwp_primary_selection_device_manager_v1 global removalVlad Zahorodnii2022-12-132-5/+9
| | | | | | | | | | | The zwp_primary_selection_device_manager_v1 global can be withdrawn if the compositor disables the primary selection, i.e. middle click to paste selected text. QtWayland needs to handle that; otherwise the app can crash. Pick-to: 6.5 Change-Id: Idbb4db18b605f85a5951fa12c1bdf61898b0d123 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* compositor: fix build without quickLiang Qi2022-12-095-0/+21
| | | | | Change-Id: Ic9ff039028e509c3e09d446f85648fe063f4749f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Provide support for custom shellsVlad Zahorodnii2022-12-083-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, an application can use only one shell surface protocol at a time. However, there are applications that need to use more than one shell surface protocol, e.g. xdg-shell + layer-shell. layer-shell can be used for the desktop background window, and xdg-shell for popups, etc. This change introduces an API in QWaylandWindow that allows specifying the shell integration per window. Custom shell code needs to call QWaylandWindow::setShellIntegration() while the window is unmapped. By default, QWaylandWindow will use QWaylandDisplay's shell integration plugin. This change should be source compatible with existing shell integration plugins deployed in the wild. If the custom shell wants to track additional state for the window, it should do it using its own means. Perhaps we could improve this in the future releases of Qt. [ChangeLog][QtWaylandClient] It is possible to run Qt applications using more than one shell surface protocol, e.g. xdg-shell + layer-shell. Change-Id: Id0458b32af623f114c06d51d0d21ad06efd69328 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Implement QNativeInterface::Private::QWaylandWindowDavid Redondo2022-12-0812-7/+50
| | | | | | | Task-number: QTBUG-94729 Change-Id: Ib79f3199a4518700aa032c5ca4760a2b53c401e5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Implement fractional_scale_v1 and wp_viewportDavid Edmundson2022-12-0711-7/+372
| | | | | | | | | | | | | This allows compositors to hint a non-integer scale to use on a window which we can hook to Qt's existing fractional scaling support. The viewport is used to communicate the relationship between buffer size and logical size to the compositor. It is a non-integer alternative to wl_buffer_scale Change-Id: I1a850f1bcd40e8d04e241e18a538b11f18bc671c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* compositor: Support touch interaction with client decorationsEskil Abrahamsen Blomfeldt2022-12-072-13/+33
| | | | | | | | | | | | | | | | | | | | The client tells us when the title bar has been pressed and it has started a move, but we only actually updated the position of the window for mouse events. This adds touch event support for this, but only for a single touch point. Since there is no way of knowing which touch point actually triggered the move, we just assume it is the first. This could cause some odd behavior if you try interacting with the window frame with two fingers at the same time, but not beyond what you would expect. [ChangeLog][QtWaylandCompositor] It is now possible to move windows using client-side decorations with touch input as well as mouse input. Fixes: QTBUG-108690 Change-Id: I23ce1e39a26be5b1b5a5ac93d8f38cc59685aa96 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* compositor: Fix warning on damage/damage_buffer mixEskil Abrahamsen Blomfeldt2022-12-072-27/+22
| | | | | | | | | | | | | | | | | The damage() request has been deprecated in favor of the damage_buffer() request, which is the one we use in Qt 6 as long as the version is 4 or higher. See change: 314fd6db51277224cdc799b039ef79db1101f5cd. However, eglSwapBuffers() will in some drivers still send the old request, causing us to get a mix of incompatible requests, since they are in different coordinate systems. We need to store these separately so that we can apply them both correctly once we get a commit. Fixes: QTBUG-108765 Change-Id: I9bbe0c87731847a4fa1927957dfd8945bd49c474 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>