summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Client: fix a typo in minimum window size handlingIlya Fedin2023-05-151-1/+1
| | | | | | | | | Amends 42128ec10e2365b5235a80ebc0bb429402b8f95f Change-Id: I3919b913aa7b09f9d0863344d72e9f6e14a8634a Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 2887b351ed70e1151cb88755ecc63fa99c12b0f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Apply only valid min/max sizesInho Lee2023-05-102-7/+17
| | | | | | | | | | | | | | | When setting min/max sizes, the minimum size can be larger than the maximum size. In that case, the size hint won't be applied to the geometry. Setting size hint will be pending until the min/max pair is valid and the actual geometry will not be changed with the invalid size hint. Fixes: QTBUG-113233 Change-Id: Ia05944e8342e7f8d794aee7883e0637a4c711c9d Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 42128ec10e2365b5235a80ebc0bb429402b8f95f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* compositor: adapt to new QXkbCommon::modifiers()Mario Roessel2023-04-281-1/+1
| | | | | | | | | Fixes: QTBUG-111503 Done-With: Liang Qi <liang.qi@qt.io> Change-Id: Ib6adb03575c06f667ec5d7a0139b4396888d4010 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit f614fdfa5dc522f805c7c061535df6a0dc7409b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Exclude hardwareintegration plugins from Unity BuildAmir Masoud Abdol2023-04-251-0/+6
| | | | | | | | | | | It seems that when <EGL/egl.h> is included, we get conflicting symbols between QUrl, and X11 symbols. Task-number: QTBUG-109394 Change-Id: I6a4d6c475d43d0f8f35a27b855a69cf6f842742a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit a101e63bc0d97232b60fba0e2f52e59499210fa0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use correct CMake component namePaul Wicking2023-04-241-1/+1
| | | | | | | | | | | | | | | The documentation wrongfully states that the name of the CMake component for Qt Wayland Compositor is `Waylandcompositor`. The correct component name is `WaylandCompositor`, see e.g. qtwayland.git/src/compositor/CMakeLists.txt. This change corrects the typo. Fixes: QTBUG-113022 Change-Id: I158c8d93e664bd729c912d2f7424a99ea3713ab8 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> (cherry picked from commit a38b75ba02b11a3ab838e892e0468d0b8aaac7eb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWaylandWindow: Init parent wl_surface when creating subsurfaceDavid Rosca2023-04-191-0/+2
| | | | | | | | | | Fixes recreating subsurfaces after hiding and then again showing the window. Change-Id: I2e3e7ceb42ec6b25cb64db260dfb74f6ebb10d27 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit d06d66fad70d7c61559211b6f489b94d1c3a8a05) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document sendFullKeyEvent() and sendKeyEvent() limitationsPaul Olav Tvete2023-04-181-0/+8
| | | | | | | | Task-number: QTBUG-112853 Change-Id: I5ae7ee194e8415c5e34ecde2d93086885866abfd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 558babd4bc3cbd1f6eb9f17f263313fd7b40069a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Client: Use correct type in vulkan window for nullDavid Edmundson2023-04-131-1/+1
| | | | | | | | | | | VkSurfaceKHR is not a pointer, nullptr is not always the same size. Task-number: QTBUG-112808 Change-Id: I12e5f61b67b9aa331f7e42a952413e922d09eb8d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 4f607ebfca1d40fe25eb1afdbfebb1265f4ce65c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Destroy frame queue before displayDavid Redondo2023-04-111-2/+3
| | | | | | | | | | wl_event_queue_destroy accesses the display. Found by running a test under valgrind. Change-Id: Ic89cbd3b6e98b4fc9561b0e63b5fab4886a1ec50 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit a76bf824fcd1cc3789f0d3454a0423c0241d9718) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Client: Check for shell integration when initializing platform pluginIlya Fedin2023-04-037-18/+18
| | | | | | | | | | | | | | | This makes QWaylandDisplay::initialize return a boolean and moves the QWaylandIntegration's failure check out of constructor as QWaylandIntegration::shellIntegration is a virtual method, this also removes the out-of-date comments about processEvents as it's no more used in QWaylandDisplay::forceRoundTrip. Fixes: QTBUG-102457 Change-Id: I3c8f1d9fd195326b587b45318443c2beee1ebfc2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 2eb17abf4262b467140ed4262320bf60cbda3ba2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Client: let QWaylandClientExtension work before platform integration is assignedIlya Fedin2023-04-033-8/+10
| | | | | | | | Task-number: QTBUG-102457 Change-Id: Ia47478a4fbf45ba96fd73c6a1a53c2b844aa41b4 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit b66d93c6b827ef2d194916c68f1f64fe874d5163) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Client: Cleanup vulkan surfaces on hideDavid Edmundson2023-03-312-5/+13
| | | | | | | | | | | | Otherwise a hide/show combination will result in use of wl_surface after it has been destroyed by QWaylandWindow. This closely matches what the pattern we use for QWaylandEGLWindow. Change-Id: Ic23f947046ce521125dfa8a3c22f5529dfcbece2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit d78e8c02846a3634445a808d9845be8613bb1bfe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I864a1cb68b3660d858623f943b3958f7cafbf955 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit e3c74961b1c7415fd94678802ad7f8173d0be4c1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.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. Change-Id: I8d2a3372fe6de51f357eed513baaa34a148470e3 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 504b9f1491d7244d05bee243bacf03aa9df1a17c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 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> (cherry picked from commit 2eeefbb706d8fce8d70d454c5e9ceda3ecae2479) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.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 Change-Id: I1b98afc8b5c867ecb7cc586267b13f7ec4b1a88c Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit ae026d6ac7b7910b9f3934a1df2b69d3fce344bc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.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. Task-number: QTBUG-87303 Change-Id: I4021f497b78e62651fe606c4be21a387a92edd6c Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit d7a5dab0182cba19d7f59e542672aa3d1b2e859e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Task-number: QTBUG-110993 Change-Id: I91ad127611c7b1e4d8c558377bc5f46e0ec28a41 Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit bc612e4ecc06aeba5f829913054614f959eca1a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.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 Change-Id: I0f341a64199637a415898309763f9b5416fc4be1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 5703d0a242aef9402d4b72ab50fe336f453e49fd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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); | ^~~~~~~~~~~ Change-Id: I4b9b3a13ac47483594f454ba36dc5d720cb592a5 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 12da86346954f7290e3e1fb00f5c5f2307d2fd58) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.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 Change-Id: I8ed19f1be17f49fa9748b1cb5fdd0070791d2ecd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 2fa2a5184dcdf54a7868d73418ed141713587969) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: If1202537a40d746e263fd6e6f67e316a2cdb109e Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit a328e2c5e0594ff476a9df2fcdc3b03894ff7a15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.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 Change-Id: Iccce8845bb669df93f1be43cbe9b9d25f7fd5235 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit baada964fa554bd06d6f8ce2d1afd88902ea73b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disambiguate Vulkan debug constantsFriedemann Kleint2023-02-133-34/+34
| | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Task-number: QTBUG-109394 Change-Id: I4dfef40309a42b8fa662dfa3d99b65d920480aba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit b80b8ec9213e404062e449c7baad6db00483aef2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Exclude sources generated by the scanner from CMake Unity (Jumbo) buildsFriedemann Kleint2023-02-131-4/+6
| | | | | | | | | | The generated helper function wlRegistryBind() clashes. Task-number: QTBUG-109394 Change-Id: Ib814d4576c7565b0413ca16bc0bf5e95caa92c33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit f5445e74b54d96ca215f5c8b01874174a4efbd9f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QWindow forward declarations in namespacesFriedemann Kleint2023-02-132-2/+0
| | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Task-number: QTBUG-109394 Change-Id: Idc0d0baeef4b92f61ed67d9a850b5ad3422f9146 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit decc4fb68dfb449e82dc0219365c95c130ede36f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disambiguate input method constantsFriedemann Kleint2023-02-133-8/+8
| | | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. 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> (cherry picked from commit 6ec8ce9a06e5ccb16f5fc3a5f857425f3db87c80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disambiguate static variablesFriedemann Kleint2023-02-138-24/+24
| | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Task-number: QTBUG-109394 Change-Id: Ia6e293fa30d788f8abd52bf675f11d7d0151259f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 948fbd1cd64f9d5e129deade61ecd3dbc5f9b60f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: I17c9db09e7d0a649ab3a37ed867d4f81e039d485 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 57c5406c6d7ca7ca0e95e558ab81a15ebf3381cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Fixes: QTBUG-109051 Change-Id: I2249f0881b90fc05b5f0292cd35c6524db4663c5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 0088b09e79da01534a703f69dbccbd721e7594d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. 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> (cherry picked from commit db4afd9caf037cfff7aca8b130d326c340b7fed0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I5cd6664d1a7c315019d6c798b33b9deb33982a59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a3896c8a036c6a9b19d889c212769d72e70257c4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: Ia3a8075e471d5a4b619f420ee166e7146f1229b8 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> (cherry picked from commit f0de6ff9606ea2bf0622f8d8c67e8688be86bf0d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_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. Change-Id: I8540e7a02df1579b3380a1a1d4cfab42c1ab3104 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e954853f0e68d78ac1a98bc3533713881496064c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_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. Change-Id: I9e44f9c6dddbb5d730f8ac092f2c11fdbccf8d27 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 1c25db5e3f23d48e330170f41b94fbd532932b02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I0f894adb3f688458a65713e343127fbcb26f8b65 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ff445c2c7c93a64922ae437cbbdc95542360c7ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: Idbb4db18b605f85a5951fa12c1bdf61898b0d123 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 45163234a4e4baad0012d3ee07501093d98ba91c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Compositor_api: delete TexProvider properlyInho Lee2022-12-072-2/+21
| | | | | | | | | | | If a QuickItem used in a compositor has a texture provider, it is not destroyed before deleting QRhi. It makes a warning of unreleased resources. Fixes: QTBUG-108767 Pick-to: 6.4 Change-Id: Id86839f1de1ff4f374170627d9c1e02c4afb7301 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Improve handling of 0xH and Wx0 xdg_toplevel configure eventsVlad Zahorodnii2022-12-051-8/+27
| | | | | | | | | The compositor can send a configure event with 0xH and Wx0 when it wants the window to have some concrete size along one dimension but wants the client to pick the size along the other dimension. Change-Id: I2e72017d4a71b19a930da24fa5c58b6ce672fb94 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Allow resizing with touch input on client-side decorationsEskil Abrahamsen Blomfeldt2022-12-051-37/+80
| | | | | | | | | | | | | | | | | | The touch input for client-side decorations had its own handling which only processed button clicks and moves. This meant that it was impossible to resize windows using touch events. This generalizes the mouse input code path and uses it for touch as well. We need to take care not to update any mouse state in the case of touch, since we only care about touch press events, so we pass in a PointerType and disable parts of the code path when the input is from a touch device. [ChangeLog][QtWaylandClient] Enable resizing windows using client-side decorations with touch input as well as mouse input. Task-number: QTBUG-108690 Change-Id: I761ebb0c7c4844c52f793caa74e8606d1593757f Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Fix frame sync related to unprotected multithread accessWeng Xuetian2022-12-032-32/+43
| | | | | | | | | | | | | | There is a few crashes happens in real life that frame callback is double-free'd and hit an assertion in wayland-client. e.g. https://bugs.kde.org/show_bug.cgi?id=450003 This is due to the WaylandEventThread and calls to QWaylandWindow::reset may free and unset the mFrameCallback at the same time. mFrameSyncMutex should be used to protect such access. Pick-to: 6.4 Change-Id: Ie01d08d07a2f10f70606ed1935caac09cb4f0382 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Honor QGuiApplication::overrideCursor()Vlad Zahorodnii2022-11-301-1/+4
| | | | | | | | | | | If there's a QGuiApplication::overrideCursor(), QWindow::cursor() can still return a different cursor. This can result in a wrong cursor when the pointer enters a window. Pick-to: 6.4 6.2 5.15 Fixes: QTBUG-75919 Change-Id: I015117b4b6d252b421ab14bd8f2a8f582f7cae52 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Improve examplesBernd Weimer2022-11-251-2/+4
| | | | | | | | | Updated signal handlers to new syntax to reduce noise (warnings). Allowed to build examples with subfolders in one step, updated from deprecated WlShell to XdgShell, etc. Change-Id: If821363ffd1b38ea1d152f5a044b0609cf739014 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>