summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "QWaylandDisplay: Allow software-only deco and don't init GL ↵Kai Uwe Broulik2024-05-151-1/+6
| | | | | | | | | | | | | needlessly"" This reverts commit 171e1d0d2761ba64cb15edbd32d02fb50ef57d28. Reason for revert: Cause for test failure has likely been addressed by b9a5ffab93627cfedcead1574c8f0fd010b329b5 Fixes: QTBUG-124284 Fixes: QTBUG-124285 Change-Id: Iedeb1d2800951e549fe4a4846aaaa477cfa497ae Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Disentangle platform services and windowmanagerintegrationDavid Redondo2024-05-101-4/+4
| | | | | | | | | The current state was a bit messy with the platform services being the potentially no initialised qt window manager extension wayland object. Change-Id: Id1f911b75d34fcf70594ca7257b79bf431f0643f Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Revert "QWaylandDisplay: Allow software-only deco and don't init GL needlessly"Eskil Abrahamsen Blomfeldt2024-04-111-6/+1
| | | | | | | | | | | | | | | This reverts commit 3652666c559382f6d575fa4102e132b71a58785f. This optimization causes flakiness in the xdgdecorationv1 test, possibly because it no longer handles the case where the supportsWindowDecoration() function is called before the buffer integration is initialized. So it unfortunately has to be reverted until a better approach can be figured out. Fixes: QTBUG-124259 Change-Id: I05f13a51b22b6779bffba531f08ebfd17a9afb38 Reviewed-by: David Redondo <qt@david-redondo.de>
* QWaylandDisplay: Allow software-only deco and don't init GL needlesslyKai Uwe Broulik2024-04-021-1/+6
| | | | | | | | | | | | Don't initialize the client buffer integration just to check whether it can do a decoration. If we had a GL window, it would have initialized GL already. Also, we can do software-rendered decorations nowadays, only disable them if the integration explicitly says it can't. Change-Id: I396d32796a10ccffd6ef3bb0c5eaa3a1078b8d79 Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use static_cast rather than dynamic_castLu YaNing2024-03-211-2/+2
| | | | | | | | | | | To avoid RTTI. When I tried to implement the reconnect function in Plasma5, I found that the application would have a dynamic_cast crash problem. Referring to other usage logic and suggestions in Qt, it is recommended to avoid using dynamic_cast. Change-Id: I4fd41846c3215f60aafc7e38d1542d52ec6759b8 Reviewed-by: David Redondo <qt@david-redondo.de>
* Support multi-key for input context pluginJiDe Zhang2024-03-101-4/+4
| | | | | | | | | | Sync from QPlatformInputContextFactory::requested in 8596998cb025a8338c9403f5ef9db5a23f5cc682 of qtbase to QPlatformInputContextFactory. Fixes: QTBUG-120202 Change-Id: Ib15d8a59c4cb3baaa19355ed5d7c30c87a7a1c16 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Prefer text-input-v2 over text-input-v3 for nowWeng Xuetian2024-02-121-2/+6
| | | | | | | | | | | | | | Qt's current text-input-v3 is converted from text-input-v4, but it's current state is poor and does not support the same feature like v2. KWin is the only major party that implements text-input-v2 and many feature e.g. Plasma-mobile would require v2 feature to provide the complete support. Until v3 is as good as v2, prefer v2 over v3 should provide a smoother experience on KWin (for both 5/6) out of box and won't affect other compositor. Pick-to: 6.7 Change-Id: Iebfe20cfd61f4a96018c4d41a9c4c706b18c7199 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Switch qt-toplevel-drag to xdg-toplevel-dragDavid Redondo2024-02-021-4/+4
| | | | | | | | | | | | While no released compositor implemented qt-toplevel-drag it was a valuable to step to prove the protocol and the Qt implementation together with development pre-release versions of KWin. Now that the protocol is standardized we can switch to that version which is functionally identical. Pick-to: 6.6 6.7 Change-Id: I3beefe542cbabeddba4468b5d1fa24fcb05a2e5a Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Clean up old registry on reconnectDavid Redondo2024-02-011-0/+2
| | | | | Change-Id: Idcaf1aaef59529f0cb49c552418a434f7d449d7b Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Fix deletion of new queued shm buffers during reconnectDavid Redondo2024-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | When reconnecting the cleanup of existing buffers is delayed in order to preserve contents and copy them to buffers belonging to the new connection. Due to the order of events it could happen that a new buffer was deleted along with the old ones but still being referenced by a window. During reconnect all QScreens are removed and new ones added for the wl_outputs on the new connection during the initial roundtrips. When the first new QScreen is added all QWindows move form the placeholder screen to it. This can cause for example QWidgets to repaint. At this point the windows are not reinited yet, and the buffer is queued inside the window. Only afterwards the reconnected signal was emitted which would cause deletion of all existing buffers including the newly queued ones. To fix this the signal is moved after the first roundtrip where all globals are announced and new buffers can be created but no new screens have been announced yet. The signal is renamed to be more fit for its new location. Pick-to: 6.7 Pick-to: 6.6 Change-Id: I06be14d235ac342a4b420176aadad3ccf18178fe Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Destroy window manager integration before displayDavid Redondo2024-01-231-0/+1
| | | | | | | | | Like the globals window manager integration needs the display to be alive. Fixes: QTBUG-121364 Change-Id: I3bf10737f9c1aa6d0b3c34d2268532ea6fc4e957 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Make sure wayland object destructors are calledDavid Redondo2024-01-171-18/+44
| | | | | | | | | | | Always at least call the generated "interface"_destroy method which does destroy the proxy. For not already wrapped classes a small template is introduced to pass a function that is called in the destructor. Fixes: QTBUG-111576 Change-Id: I373463710764958ddea42ef0f7dc010c427b2ce8 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Support TextInput V3 over v4-wipDavid Edmundson2023-12-131-30/+17
| | | | | | | | | | | | | | | | | Support for v4-wip was not added into any desktop linux compositors, nor was it ever enabled into the default Qt client builds for clients or compositor. TextInputV3 has become the most widely deployed. Whilst changes are needed, they do not need to be breaking changes. A second iteration of V3 can add the features we need. This is now in motion upstream. For cases where QtWaylandCompositor is used, the custom Qt text input method is preferred to work with the Qt virtual keyboard. Pick-to: 6.7 Change-Id: I01e2686c67846804c0069f1495952b530547f91c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove redundant static uint32_t QWaylandDisplay::currentTimeMillisec()Edward Welbourne2023-11-271-10/+0
| | | | | | | | | | Fortunately it was unused. Its 32-bit unsigned return type, measuring time in milliseconds, wraps around every 50 days. If Qt Wayland ever does need to know the current time in milliseconds, I can recommend QDateTime::currentMSecsSinceEpoch(). Change-Id: I03e70e3c7060b1e8fb82fc2e151bb187b6598b96 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Follow up handleWindowActivated -> handleFocusWindowChanged renameTor Arne Vestbø2023-11-241-1/+1
| | | | | | Change-Id: I75eeae6dfa4af8a17dffaef74f15fc87a58bcf61 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* QWaylandSurface: client support wl_surface version 6JiDe Zhang2023-11-021-1/+1
| | | | | | | | | | | | | | Add QWaylandWindow::updateScale() function to update the window's scale from QWaylandFractionalScale or QWaylandSurface::preferredBufferScale or QWaylandScreen::scale or QWaylandSurface::preferredBufferScale. Add QWaylandWindow::updateBufferTransform() function to update the window's buffer transform from QScreen::primaryOrientation or QWaylandSurface::preferredBufferTransform. Change-Id: I2742701e92c7403a89df97b7fa06b5b0de6917a7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Make sure screens stay virtual siblings during reconnectDavid Redondo2023-07-281-3/+3
| | | | | | | | | | | The virtual siblings of QWaylandScreen are constructed from the list of screens in QWaylandDisplay. It is important that when a window changes screens due to handleScreenRemoved that the screens are siblings otherwise the platformwindow is destroyed and window becomes hidden. Pick-to: 6.6 Change-Id: I7ceeee4e18fbdfa936fe987441d35b8a5cb1eefd Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: no need to update decoration when shutting downLiang Qi2023-06-301-0/+3
| | | | | | | Fixes: QTBUG-114995 Pick-to: 6.6 6.5 6.2 Change-Id: If7eaefc8cc0778246f13604809740426bcffa9f8 Reviewed-by: Liang Qi <liang.qi@qt.io>
* client: Fix variable names for QWaylandDisplay::GlobalHolderInho Lee2023-06-301-9/+9
| | | | | | | | | After c4d0e10, wayland-text-input-v4-wip was broken. In addition, mTextInputManagerv2 will be changed to textInputManagerv2 as other protocols. Change-Id: I5476a1bba579ef1d915959b3c3881cf80a56587d Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Use nullptr instead of 0 in QWaylandDisplayLiang Qi2023-06-281-1/+1
| | | | | | Pick-to: 6.6 6.5 6.2 Change-Id: I7c1f3a24e55d1825fd6c941cd55b51cf195836da Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Move wayland globals into a holding structDavid Redondo2023-06-131-73/+69
| | | | | | | | | This way all globals get automatically reset by reassigning a default constructed value to the holder. This way a newly added global will not be missed in the future. Change-Id: Id3a62e30427cec9980ea076366e30b419ce1c2c6 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Add missing globals to reset on reconnectDavid Redondo2023-06-061-0/+2
| | | | | | | | | These were recently added and not reset on reconnect. Pick-to: 6.6 Change-Id: I3b030154447662c9b9fde9b44cbea994333d464c Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Implement qt-toplevel-drag-v1David Redondo2023-06-051-0/+4
| | | | | | | | | | | | | This protocol for tabs toolbars and dock widgets to be dragged in and out of a main window using an extended version of the drag and drop protocol. Application code in QtBase use a special internal mimedata to specify a window that should be associated with a drag. This is 1:1 match with the pending upstream proposal xdg-toplevel-drag, and can be switched when that lands. Change-Id: Idf0afb71cd98d45938b4641ce861484fffac911c Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Implement cursor_shape_v1David Edmundson2023-06-011-0/+3
| | | | | | | | | | | | | | A new wayland protocol allows clients to specify the cursor being used rather than load themes and attach buffers. Short term this has better behavior for scaling. Long term when this has universal compositor support we can drop the theme loading code. Change-Id: I119e1ca44d351e7b13b8ec56f2218d94b7da0705 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Properly clean up screens during reconnectDavid Redondo2023-05-171-3/+6
| | | | | | | | Otherwise the old screens are left dangling. Also create a placeholder screen so the windows get assigned a valid screen upon reconnect. Change-Id: Iea5d1da6f32be5e87464412447ae1449d91d8e75 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>
* 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>
* Client: Check for shell integration when initializing platform pluginIlya Fedin2023-04-031-1/+6
| | | | | | | | | | | | | | 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>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-071-18/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 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: Handle zwp_primary_selection_device_manager_v1 global removalVlad Zahorodnii2022-12-131-0/+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>
* Implement fractional_scale_v1 and wp_viewportDavid Edmundson2022-12-071-0/+17
| | | | | | | | | | | | | 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>
* 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>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-101-15/+15
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Ia64c6615ee81f7ad5d0658449b0ee347c3db8c29 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Port from container::count() and length() to size()Marc Mutz2022-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I574208abc90a8042b500b3f96e3862b0ff339eb6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Replace qExchange with std::exchangeMarc Mutz2022-10-061-2/+2
| | | | | | | | | | None of these users require C++20 constexpr or C++23 noexcept, the only remaining difference between std::exchange and qExchange. Task-number: QTBUG-99313 Change-Id: Ic5a0bd36d715af2cbc5f9936fdff665ee6eeea4e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Fix several more improperly placed #include mocThiago Macieira2022-07-281-2/+1
| | | | | | | | | | | | | | Like commit qtbase/638893bea083b619b73b33a7dd5589fb2c4c4242. Script to find them: git grep -l '#include.*moc' \*.cpp \*.mm | \ xargs awk '/QT_BEGIN_NAMESPACE/ { i=1 } /QT_END_NAMESPACE/ { i=0 } /#include.*moc/ && i { print ARGV[ARGIND], $0 }' Pick-to: 6.4 Change-Id: I6f936da6f6e84d649f70fffd17058fd05cfc5c6d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Also use text-input if QT_IM_MODULE is empty or "wayland"Weng Xuetian2022-07-131-0/+4
| | | | | | | | | | | | | | Previously, text input can only be used when only when QT_IM_MODULE is unset, it is counter-intuitive when empty and null has different meaning. Additionally making "wayland" to use text input to make it easier to enforce wayland context. Gtk's relevant value is also "wayland" so it will be more consistent. Pick-to: 6.4 6.3 6.2 Change-Id: I39b8c899b0ab7965d4b17ca29ed9eadc14f17e88 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* Use SPDX license identifiersLucie Gérard2022-06-101-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I106d3a5d1a7b96250380b6f51a48f3b19d10e4d9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtWaylandClient: includemocsLiang Qi2022-06-011-0/+2
| | | | | | | Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-103295 Change-Id: Ibac5e794c7d7f35d51d8d48110892c33a0b67c7a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Replace QScopedPointer with std::unique_ptrThiago Macieira2022-05-111-1/+1
| | | | | | | | | | | | | As the warning asked. qwaylandshellintegrationfactory.cpp:67:28: warning: ‘T* QScopedPointer<T, Cleanup>::take() [with T = QtWaylandClient::QWaylandShellIntegration; Cleanup = QScopedPointerDeleter<QtWaylandClient::QWaylandShellIntegration>]’ is deprecated: Use std::unique_ptr instead, and call release(). [-Wdeprecated-declarations] As a drive-by, change *foo.get() to *foo. Pick-to: 6.3 6.2 Change-Id: I7fb65b80b7844c8d8f26fffd16e97fe161d6a67a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* client: Avoid trying to read/cancel read if wl_display_read_events failedDavid Edmundson2022-03-231-0/+3
| | | | | | | | | | | | | | | | wl_display_prepare_read and wl_display_read_events/wl_display_cancel_read must come as matching pairs. Otherwise we set libwayland's internal read count to a negative number and causes all types of deadlocks. If prepareReadQueue fails but we haven't explicitly quit waitForReading returns a success statement but we haven't opened anything. Pragmatically most times wl_display_prepare_read fails it's because of a wayland error which is handled by exiting anyway, but it is better to err on the side of safety. Change-Id: Ia29c3217622d97594404be3daf4c50338a1d3fb0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add globalRemove to QWaylandClientExtensionDavid Redondo2022-03-091-1/+2
| | | | | | | | | | | | Adds support for handling of removal of the relevant global to QtWaylandClientExtension. The user is responsible for destroying the object once it becomes inactive to match the behavior on destruction. Two signals for globals and their removal are added to QWaylandDisplay to make it a bit nicer to use in a more "Qt-way". The addRregistryListener function is kept for now until other places are ported. Change-Id: I4ccbaa32e18a5ae15871aa23639e2b4a372cc34e Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Reduce memory leakageUlf Hermann2022-02-231-0/+3
| | | | | | | We need to clean up the event queue when we're done. Change-Id: I13a9eb77e978f4eab227a3a28dab8ebc8de94405 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Simplify round trip behaviorDavid Edmundson2022-02-141-42/+1
| | | | | | | | | | | | | | | | The custom event queue was removed in 302d4ffb8549214eb4028dc3e47ec4ee4e12ffbd (2015) so the comment about not being able to use the inbuilt round trip method no longer applies. This fixes a real world problem. Use of a blocking round trip should not process non wayland events. Doing so can lead to misbehaviour client side as things happen out of order. The move to the event thread created several regressions as we now get events before the QGuiApplication is fully constructed. Change-Id: I650481f49a47ed1a9778c7e1bc3c48db6e8f0031 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix unused warningsShawn Rutledge2022-02-091-1/+1
| | | | | | | | | Unused lambda capture and private variables that clang complains about. Pick-to: 6.2 6.3 Task-number: QTBUG-100249 Change-Id: I204eea8d4fc0c22542224d94bae113fa66870d15 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add client support for the text-input-unstable-v1 protocolDominik Holland2022-02-021-2/+36
| | | | | | | | | | | | | | | | This is used by weston for forwarding virtualkeyboard related event from keyboard applications to a Qt client. Right now Qt only supports text-input-unstable-v2, v4 and the special qt-input-method protocol, while weston only supports text-input-unstable-v1. Without this, a virtual-keyboard application can't be used with a Qt client within weston. Change-Id: I9a34a87100854bb0b0f76762ced56419e70c297e Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix build with -no-feature-tableteventLiang Qi2022-01-251-0/+4
| | | | | | | | Pick-to: 6.2 6.3 5.15 Fixes: QTBUG-99965 Change-Id: Ib7fcf92973b4e559713ae27ad0c7f843f9122daf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Client: Implement DataDeviceV3David Edmundson2021-12-091-1/+1
| | | | | | | | | | | | | | | | | | | DataDeviceV2 fixes a leak of DataDevice resources. DataDeviceV3 brings multiple improvements: Action negotiation. The source announces which actions are supported, the target then announces which subset of those action the target supports and a preferred action. After negotiation both the source and target are notified of which action is to be performed. Drag sources are now notified when contents are dropped and when a client has finished with the drag and drop operation. A good test is the draggableicons example in QtBase. Change-Id: I55e9759ca5a2e4218d02d863144a64ade53ef764 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support text-input-unstable-v4-wipInho Lee2021-11-191-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature can be enabled by -feature-wayland-text-input-v4-wip. It is disabled by default. TextInputManagerV4 is available in a compositor. zwp_text_input_v4 is available for QT_WAYLAND_TEXT_INPUT_PROTOCOL in a client It supports Hangul(Korean) with a qtvirtualkeyboard patchset (refs/changes/02/357902/3) It includes some workarounds for ibus because each ibus module has its own policy for focus-in/focus-out. enter/leave will synchronize with enable/disable and they will happen whenever focus-in/focus-out happen. Cursor/anchor positions are byte offsets. Surrounding text will be trimmed when it is over 4000 byte. For debugging, uses "qt.waylandcompositor.textinput" in a compositor side uses "qt.qpa.wayland.textinput" in a client side Tested on qtvirtualkeyboard and ibus TODO : * QTBUG-97248 - event:preedit_commit_mode is not implemented yet. Current preedit_commit_mode is 'commit'. * request:set_text_change_cause is not implemented. Task-number: QTBUG-94327 Change-Id: I72644893f40f30c4b03cd6a7d05483d12bde1070 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>