summaryrefslogtreecommitdiff
path: root/src/client
Commit message (Collapse)AuthorAgeFilesLines
* Apply only valid min/max sizesInho Lee2023-05-091-3/+9
| | | | | | | | | | | | | | 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 Pick-to: 6.5 6.5.1 6.2 Change-Id: Ia05944e8342e7f8d794aee7883e0637a4c711c9d Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandDisplay: suppress warning about mixing QByteArray & QStringThiago Macieira2023-05-021-1/+1
| | | | | | | | | src/client/qwaylanddisplay.cpp:627:36: required from here qlist.h:907:20: warning: ‘bool QByteArray::operator==(const QString&) const’ is deprecated: Use fromUtf8, QStringLiteral, or QLatin1StringView [-Wdeprecated-declarations] Pick-to: 6.5 Change-Id: Ieab617d69f3b4b54ab30fffd175b5c4e76fdda4d Reviewed-by: David Edmundson <davidedmundson@kde.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. Pick-to: 6.5 Change-Id: I2e3e7ceb42ec6b25cb64db260dfb74f6ebb10d27 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Make sure doApplyConfigure() is called from main threadPaul Olav Tvete2023-04-182-2/+23
| | | | | | Task-number: QTBUG-101948 Change-Id: I867365384c43ccddf5b7a8600a3db84aa99aca6d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* 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. Pick-to: 6.5 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>
* Implement setBadgeNumber for wayland backendCarl Schwan2023-04-122-0/+7
| | | | | | | This is based on qtbase/ac973cb74fecdaedf31922dfd48ea522a7af8f51 Change-Id: Ifef0d36cef01fb673731f276d51100115678e749 Reviewed-by: David Edmundson <davidedmundson@kde.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. Pick-to: 6.5 Change-Id: Ic89cbd3b6e98b4fc9561b0e63b5fab4886a1ec50 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandClientExtension: Allow specifying destructor for wayland objectsDavid Redondo2023-04-111-3/+20
| | | | | | | | | | | | | | | | | | | | | While the template takes care of creating proxies automatically, destroying them is harder since an interface can have 0 to multiple destructors. However in the most common case there is only one or always calling one is sufficient. An additional template parameter is introduced that allows user code to specify a callable taking a pointer to the scanner generated class that should be called when the wayland object is to be be destroyed. This is done when the global is removed or upon destruction of the C++ object itself. The clientextension test is changed how it can be used. Since it works via a non-type template parameter a pointer to a (member) function can be passed or when compiled in c++20 mode a lambda or for example a function object. This new functionality is opt-in and the default behavior is unchanged. The default value is nullptr used as a tag to do not enable the new behavior. Change-Id: I8043f7106fec0cd6f2a79682e5872cfa8da3d11b Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Check for shell integration when initializing platform pluginIlya Fedin2023-04-034-15/+15
| | | | | | | | | | | | | | 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 Pick-to: 6.5 Change-Id: I3c8f1d9fd195326b587b45318443c2beee1ebfc2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: let QWaylandClientExtension work before platform integration is assignedIlya Fedin2023-04-033-8/+10
| | | | | | | Task-number: QTBUG-102457 Pick-to: 6.5 Change-Id: Ia47478a4fbf45ba96fd73c6a1a53c2b844aa41b4 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Provide hooks for parent windows to attach popups to themVlad Zahorodnii2023-04-032-0/+7
| | | | | | | | | | | | | | | | | | | | | | | The xdg-shell protocol allows to attach xdg_popups to parent surfaces that are not xdg_surfaces. For example, in order to attach an xdg_popup to a layer_surface, you would need to initialize the popup as follows xdg_popup popup = xdg_surface.get_popup(nil, positioner) zwlr_layer_surface_v1.get_popup(popup) QWaylandShellSurface::attachPopup() provides a way to perform parent-specific initialization, i.e. call zwlr_layer_surface_v1.get_popup. QWaylandShellSurface::detachPopup() was added mostly for futureproofing. The xdg-shell doesn't say exactly how the parent surface must be attached. In the example provided above, a request is used to associate the popup with its parent layer surface. But one could also create an object to represent the relationship between the two. The detachPopup() hook can be used to call the destructor request for that object. Change-Id: I43b10e77bd70751d8b4c3a0b5e1d294690bc471a Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Track parent-popup relationship in QWaylandWindowVlad Zahorodnii2023-04-032-6/+25
| | | | | | | | | | | | | | | | | | This reduces the amount of boilerplate code that goes in shell integration plugins providing popups. The main motivation behind this change though is to ensure that QWaylandWindow::addChildPopup() gets called outside the QWaylandShellSurface constructor so one could use the popup's shell surface object to customize parent-child relationship. mShellSurface = mShellIntegration->createShellSurface(this); when this code executes, addChildPopup() will be called before the return value of createShellSurface() is assigned to mShellSurface. Change-Id: I9ccfb21f46febb451bdd7b4aa7851a99f3a03655 Reviewed-by: David Edmundson <davidedmundson@kde.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. Pick-to: 6.5 Change-Id: Ic23f947046ce521125dfa8a3c22f5529dfcbece2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* 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>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-077-21/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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: Unify margins handlingIlya Fedin2023-02-282-27/+14
| | | | | | | | | | | | | | | | | | | | | | 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: 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>
* 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>
* 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>
* 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>
* 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-135-15/+15
| | | | | | | | | 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>
* 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>
* 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>
* 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>
* 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-086-7/+32
| | | | | | | 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-079-7/+253
| | | | | | | | | | | | | 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>
* 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>
* Client: Bump wl_output versionVlad Zahorodnii2022-11-221-1/+1
| | | | | | | wl_output_release is available starting with wl_output v3. Change-Id: I21822b26728ffb9318f1f8b4bd82ef7329682838 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Call wl_output_release() upon QWaylandScreen destructionVlad Zahorodnii2022-11-221-0/+2
| | | | | | | It ensures that the proxy gets destroyed. Change-Id: I915cc8814e33dd3b0405b2bf82bd12ce6b5f785b Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Add F_SEAL_SHRINK seal to shm backing fileVlad Zahorodnii2022-11-181-1/+7
| | | | | | | | | | This lets libwayland-server avoid installing a SIGBUS handler when it wants to mmap() the backing file and access the contents of shared memory client buffers. Change-Id: Id0b17f729799535d73e8700c5a99c32fd88a068a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* tests: fix tst_seatv4 to use 24 as default cursor sizeLiang Qi2022-11-081-1/+1
| | | | | | | | | | | | Also set default cursor size to 24 for client, which is correct both on KDE and GNOME at least. Fixes: QTBUG-104259 Pick-to: 6.4 6.2 5.15 Change-Id: Ie4ba27695974025b093a86d8c96fb23d25ad23f7 Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove uneeded forceRoundTrip on XdgOutputManagerDavid Edmundson2022-11-081-1/+0
| | | | | | | | | | In the first rountrip we will get all wl_outputs and the xdg_output_manager. Therefore we know we will have called wl_output.bind and xdg_output_manager_get_output by the time we hit the second roundtrip on startup. Change-Id: I69f911c13f9bcdfb59b04eceea4bcca778e7755c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add dependencies of wayland protocolsInho Lee2022-11-071-0/+2
| | | | | | | | Some macros are missing DEPENDS for add_custom_commands Fixes: QTBUG-108142 Change-Id: Ifacb2ea9bf3003c10dd407a8c77fc06b893b6a65 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Implement QNativeInterface::Private::QWaylandScreenDavid Redondo2022-11-031-2/+9
| | | | | | Change-Id: I2f5cc638f33fe0d884146342516efa7ce8474478 Task-number: QTBUG-94729 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Always use blocking write for data_source.sendInho Lee2022-11-011-0/+8
| | | | | | | | | | | | | QtWaylandClient assumes that data_source's fd is BLOCKING, but some compositors (e.g. mutter) pass an fd with O_NONBLOCK set. In this case, 'write' is not guaranteed to process all of the passed data in one call. Instead of dealing with such partial writes, remove O_NONBLOCK. Fixes: QTBUG-107076 Pick-to: 6.4 6.2 5.15 Change-Id: Ieb446da9fdfbaaa55100f573b396ee449cadc463 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>