summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Properly clean up screens during reconnectDavid Redondo2023-05-171-0/+25
| | | | | | | | 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>
* QWaylandWindow: Init parent wl_surface when creating subsurfaceDavid Rosca2023-04-191-0/+4
| | | | | | | | | 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>
* QWaylandClientExtension: Allow specifying destructor for wayland objectsDavid Redondo2023-04-111-9/+4
| | | | | | | | | | | | | | | | | | | | | 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-031-1/+13
| | | | | | | | | | | | | | 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: Add support for xdg_popup_configureLiang Qi2023-03-101-2/+20
| | | | | | | | | | | | | | | | | 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>
* Rename tst_reconnect to avoid clash with qtremoteobjectsEdward Welbourne2023-03-101-3/+3
| | | | | | | | Name is too generic, but I'll leave this module's maintainers to work out what to do about that. Left the source file with the old name. Change-Id: I0429f03ef06feeae95c2f72ac76cc75397051d9e Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-079-8/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Compile with -no-openglEskil Abrahamsen Blomfeldt2023-03-0610-10/+5
| | | | | | | | | | | A few of the tests were including Qt OpenGL for no good reason, and the link step should be optional. Pick-to: 6.2 6.5 6.5.0 Fixes: QTBUG-110420 Change-Id: Icb78c15e49070c6938bf9bb75abfed677af6785b Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Force a roundtrip when an XdgOutput is not ready yetMarco Martin2023-02-273-0/+40
| | | | | | | | | | | | 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 server-buffer example to manual testsEskil Abrahamsen Blomfeldt2023-02-1620-0/+585
| | | | | | | | | | | This is undocumented and demonstrates an experimental feature which was never maintained or exercised. It's a nice feature, so we keep the example around for when we get the time to bring it back. Pick-to: 6.5 Task-number: QTBUG-110993 Change-Id: I045cb2ef02a50017a26226c493607100ea0f1b95 Reviewed-by: Inho Lee <inho.lee@qt.io>
* Move hwlayer-compositor example to manual testsEskil Abrahamsen Blomfeldt2023-02-147-0/+203
| | | | | | | | | | | This was never actually listed as part of the examples, and it demonstrates an experimental feature which was never really in use and hasn't been maintained. So lets move the example to manual tests so that it can easily be revived later if we decide it's needed. Change-Id: I5a70701d34d76b4a8d42cf5945341d1f6e37a28b Reviewed-by: Inho Lee <inho.lee@qt.io>
* Implement fractional_scale_v1 and wp_viewportDavid Edmundson2022-12-0710-0/+347
| | | | | | | | | | | | | 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>
* Client: Improve handling of 0xH and Wx0 xdg_toplevel configure eventsVlad Zahorodnii2022-12-053-1/+32
| | | | | | | | | 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>
* Test: update MockClientInho Lee2022-11-102-1/+15
| | | | | | | | | add name and description functions in order to suppress warnings. This amends f1e71327d462d2dae0b46677bbc478afb0d1b2f7 . Change-Id: I0f638802773ce3da4574683e0783ec7405e7c0dc Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: fix tst_seatv4 to use 24 as default cursor sizeLiang Qi2022-11-081-2/+9
| | | | | | | | | | | | 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>
* Disable/fix warningsJonas Karlsson2022-10-283-2/+6
| | | | | | | | missing-field-initializers and unused variable Change-Id: I1a5ceaf53ec706786c73eecab0c002fa9153b962 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Add support for high-resolution scrollingVlad Zahorodnii2022-10-266-24/+182
| | | | | | | | | | | | | | | With wl_pointer version 8, the axis_discrete event is replaced with the axis_value120 event. The main difference between axis_discrete and axis_value120 is that the latter carries scroll deltas that can be fractions of 120, e.g. 30, etc. See also https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72 Change-Id: I4f724ead7ba146dde6d8975fa4edfcfca761769d Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-108-14/+14
| | | | | | | | | | | | | | 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-1013-74/+74
| | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | 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>
* Client: skip building tests which cannot be run on webOSJanne Juntunen2022-09-151-16/+20
| | | | | | | | | | | | WebOS developers have informed us via QTBUG-106114 that opening multiple (consecutive) windows from single webOS-QtWayland client is not supported and majority of our test cases try to do exactly that, causing a segmentation fault. Therefore we need to skip these tests. Fixes: QTBUG-106638 Pick-to: 6.4 Change-Id: Ifbdb2cfb663f8eccd3d68e30445e2a0f39b11355 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Client: clear focus on touch cancelDavid Edmundson2022-09-053-0/+38
| | | | | | | | | | | | | | When we get a touch_cancel event all touches should be treated as lifted. The next frame call focus is set, with no pending touch points but without having gone through touch_up. We call mPendingTouchPoints.last() without guards even though it is potentially now empty. Change-Id: I3719f9507c5d397d8641692271d878076b7c23b8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2336-36/+36
| | | | | | | Task-number: QTBUG-105718 Change-Id: Icb25ea4e07a38eea81f55ed59c6d3b9d37602626 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix build of manual testsJoerg Bornemann2022-08-033-82/+17
| | | | | | | | | | | Some manual tests were converted by pro2cmake and looked like example projects and tried to install into examples. Use qt_internal_add_manual_test for those. The qml-client test referred to a header file that has been renamed. Change-Id: I8f735f46c811355cc2a0f226cb33c6ca09cb3ac4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-2824-26/+26
| | | | | Change-Id: I95f27e29fdee60acecba4fbba9b1b77c1680cee5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Only close popup in the the hiercharyWeng Xuetian2022-07-241-0/+87
| | | | | | | | | | | | | | | | | Imagine following event sequences: 1. a tooltip is shown. activePopups = {tooltip} 2. user click menu bar to show the menu, QMenu::setVisible is called. now activePopups(tooltip, menu} 3. tooltip visibility changed to false. 4. closePopups() close both tooltip and menu. This is a common pattern under wayland that menu is shown as a invisible state. This patch tries to memorize the surface hierchary used to create the popup role. And only close those popups whose ancesotor is hidden. Pick-to: 6.4 Change-Id: I78aa0b4e32a5812603e003e756d8bcd202e94af4 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Also use text-input if QT_IM_MODULE is empty or "wayland"Weng Xuetian2022-07-131-1/+2
| | | | | | | | | | | | | | 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>
* Add license headers to cmake filesLucie Gérard2022-07-0836-0/+108
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: Ib014757184540728f40df71cd580f01e85fbbb56 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix some build warningsJiDe Zhang2022-07-041-6/+6
| | | | | | Pick-to: 6.2 6.3 6.4 Change-Id: I61edd5ab0f4383930ad37916e4cec4ab714274d4 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Use SPDX license identifiersLucie Gérard2022-06-1082-2813/+169
| | | | | | | | | | | 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>
* Fix the build of wip-cpp-compositorLiang Qi2022-05-054-7/+14
| | | | | | | | | But it's still missing xdg_popup_grab() and xdg_popup_destroy() at least. Task-number: QTBUG-69937 Change-Id: I4f4b5ae6303da12be8d9b0f26da5098e3d0d6eea Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* tests: fix DefaultCompositor::surface() when index > 0Liang Qi2022-03-221-8/+10
| | | | | | | | This amends 0154d0b65b139c4919a020c29846f56697b5b42c. Pick-to: 6.3 Change-Id: Id0759ebab699d762c134246d0ec9f72b03923bac Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add globalRemove to QWaylandClientExtensionDavid Redondo2022-03-094-0/+173
| | | | | | | | | | | | 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>
* tst_inputcontext: fix warning about unused lambda captureMarc Mutz2022-02-111-1/+1
| | | | | | | | | | | | | | Says Clang 10: tst_inputcontext.cpp:194:11: warning: lambda capture 'this' is not used [-Wunused-lambda-capture] exec([this] { ^~~~ Code was added for 6.3, so only: Pick-to: 6.3 Change-Id: I3818d1707e917c2c804d4ab0349e48667cf4a126 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Stop using soon-to-be-deprecated QMouseEvent constructorShawn Rutledge2022-02-011-1/+2
| | | | | | | | | | We need to provide globalPosition rather than letting QMouseEvent possibly fill it from QCursor::pos(). Pick-to: 6.3 Change-Id: I5313439512ce59608fe18554edc40d332df5ec17 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Fix missing update when toggling client-side decorationsEskil Abrahamsen Blomfeldt2021-12-211-0/+4
| | | | | | | | | | | | | | | | | | | | When CSD is toggled while a window is showing, it would change the size and recreate the buffers, but since the widget area remained the same size, we would not trigger a redraw. The result was that when you got any update to the window, it would redraw the widgets that had changed, and the rest would be transparent. Since this is a fairly specialized case, we fix it the simple way, by just issuing an extra update when it happens. This also required an update to the surface test, since there is an additional buffer commit in the beginning of the sequence now. Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-95032 Change-Id: Ic4bdb9c66a2ea76546926dd622f2d2dac5dce10c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@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>
* Client: Upgrade Seat support to v7David Edmundson2021-12-026-36/+41
| | | | | | | | | | | | | | | | | | | - Finish implementing support for axis_wheel_tilt. Some code existed already, hence only debug and unit test are changed - The unit test is renamed to seat as the only change is new events. There is nothing deprecated and therefore no need to test backwards compatibility. - Set our supported version number to 7 No version bumps of libwayland are needed, our current minimum version includes wl_seat v7. Task-number: QTBUG-96258 Change-Id: Ief18bc5cef3fcbd0699dd52ccad513d47c6c010b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Introduce new qt-shell and an API for custom shellsPaul Olav Tvete2021-12-0210-0/+1091
| | | | | | | | | | | | | | | | | | | | | | Adds a new API for writing custom shell extensions. This API is supported, but semi-public. Binary compatibility is not guaranteed. Also adds qt-shell, a new shell that maps directly to the QWindow API, and provides functionality that Qt provides on other window systems, such as absolute window positions and window activation. This shell is not intended for use on the desktop. This is a squashed commit of a development branch consisting of approximately 60 changes. Contributors: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Paul Olav Tvete <paul.tvete@qt.io> Task-number: QTBUG-94330 Task-number: QTBUG-91542 Change-Id: I419b6bd8179fe03e4da47d328c7ff4b4795b8a91 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* tst_seatv4: fix compilation with GCC/C++20Marc Mutz2021-11-161-2/+0
| | | | | | | | | Explicitly defaulting the default ctor suppresses aggregate initialization. It's also a pointless thing to do, so don't do it. Pick-to: 6.2 5.15 Change-Id: I8ec14f22ae1ead2dd6db643a6462f719fda344b8 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* tst_seatv4: fix deprecated implicit capture of this by [=]Marc Mutz2021-11-161-22/+22
| | | | | | | | | Since exec() is a synchronous call, we can just take everything by reference instead. Pick-to: 6.2 5.15 Change-Id: Ic1588db69ed6bb0d8dd39ff0439ad0fc97dd957f Reviewed-by: David Edmundson <davidedmundson@kde.org>
* tests: add test for multiple text inputLiang Qi2021-11-094-33/+203
| | | | | Change-Id: Ief343ebf9d0d6d00533eb3c698c416f4205bbfac Reviewed-by: Inho Lee <inho.lee@qt.io>
* example/tests: update com.theqtcompany to io.qtLiang Qi2021-10-262-2/+2
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-96370 Change-Id: Id0fc8ba2b552f7ab99fa208210c5bad016c3a043 Reviewed-by: Inho Lee <inho.lee@qt.io>
* tests: support ivi-shell again in tst_clientLiang Qi2021-10-195-39/+93
| | | | | | | | | | This amends 4825cf5b476b69cc4c5371535a5d10564d33aed1. QT_WAYLAND_SHELL_INTEGRATION=ivi-shell ./tst_client Task-number: QTBUG-96440 Change-Id: I3c6d06e978c9aab3a2a61797fe359e0b1e90df17 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Move the wayland socket polling to a separate event threadGiulio Camuffo2021-10-183-0/+178
| | | | | | | | | | | | | | | | | | | | | New event threads is introduced which calls poll() on the wayland fd, instead of relying on the event dispatcher by using the QSocketNotifier. This allows to call in the proper order the wl_display_prepare_read(), poll() and wl_display_read_events() functions. One thread is responsible for the default queue; when needed, it emit a signal so that the main thread can dispatch the queue. Another thread is responsible for the dedicated queue for frame callbacks; this thread will dispatch events on the thread itself. QWaylandWindow is updated to, instead of each window's dedicated event queue, use this queue for frame callbacks. Co-authored-by: Ratchanan Srirattanamet <ratchanan@ubports.com> Task-number: QTBUG-66075 Change-Id: Ibb33ad7f4193b866d1b8d7a0405a94d59dcad5eb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tests: port tst_client to use shared folderLiang Qi2021-10-0627-2463/+504
| | | | | | | | | instead of shared_old Task-number: QTBUG-96440 Change-Id: I1f9e04841b432937e47ed337b05fe96b2e0662fc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Wayland client: use wl_keyboard to determine active stateMéven Car2021-10-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit f497a5bb87270174b8e0106b7eca1992d44ff15d made QWaylandDisplay use the xdgshell's active state for QWindow::isActive(), instead of using wl_keyboard activate/deactivate events. That seems to have been a misunderstanding, since xdgshell activation is only supposed to be used to determine visual appearance, and there is an explicit warning not to assume it means focus. This commit reverts this logic back to listening to wl_keyboard. It adds a fallback when there is no wl_keyboard available to handle activated/deactivated events through xdg-shell, in order to fix QTBUG-53702. windowStates is handled so that we're not using the Xdg hint for anything with QWindowSystemInterface::handleWindowStateChanged or anything where we need to track only having one active. We are still exposing it for decorations, which is the only reason to use the Xdghint over keyboard focus - so you can keep the toplevel active whilst you show a popup. Change-Id: I4343d2ed9fb5b066cde95628ed0b4ccc84a424db Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Don't always recreate frame callbacksGeorges Basile Stavracas Neto2021-09-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main QWaylandWindow method that is executed when handling updates is QWaylandWindow::handleUpdate(). This method always, unconditionally queues a frame callback, regardless of whether any other one is already queued. On some circumstances, e.g. when a window is hidden or completely obscured by other windows, it stops receiving frame callbacks from the compositor. However, QWaylandWindow would continue to request for them, which eventually fills up the Wayland socket, and causes the application to crash. This can be avoided by checking if the platform window is already waiting for a frame callback, before queueing another one. In QWaylandWindow::handleUpdate(), check if mWaitingForFrameCallback is true before queueing frame callbacks, and early return if that's the case. The XDG-shell test needed to be updated for this: The mock compositor is not responding to any frame callbacks, so the window will be unexposed, no longer get paint events and therefore not trigger any commit. This worked by accident before because we were issuing updates quickly enough to reset the timer before it had a chance to unexpose the window. The easiest fix is just to disable the dependency on frame callbacks in this test, since that is clearly not what it's testing. Task-number: QTBUG-81504 Change-Id: Ieacb05c7d5a5fcf662243d9177ebcc308cb9ca84 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Georges Basile Stavracas Neto <gbsneto@gnome.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-224-4/+4
| | | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Pick-to: 6.2 Task-number: QTBUG-95018 Change-Id: I43575e48cb4ddb70b80f09e0432a2f88b01bec86 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Unskip tst_xdgshell::showMinimized()Eskil Abrahamsen Blomfeldt2021-09-221-1/+0
| | | | | | | | This passes now, so re-enable it. Change-Id: I2e0c40d5d2f3b6bb84f71f4ad192384f88e8e34e Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>