summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Client test: Prefer UTF-8 when ASCII is also availableJohan Klokkhammer Helsing2019-01-301-0/+38
| | | | | | | | | | | [ChangeLog][QPA plugin] Fixed a bug where pasting from the clipboard would prefer ASCII over UTF-8, causing loss of special characters. The bug was fixed in QtBase, this is just the test. Task-number: QTBUG-54786 Change-Id: Ibe08bf455ad0be8fdd7a3e082dec6131f19c25d6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add client test for data deviceJohan Klokkhammer Helsing2019-01-309-0/+279
| | | | | Change-Id: Id89ec40a3f484808385401829a09a43781a1bed7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client tests: Add simple test for keyboard pressJohan Klokkhammer Helsing2019-01-305-5/+101
| | | | | Change-Id: Ib28be5277af9145834c7808f993c747e21845616 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix platform integration not building with -no-feature-wayland-serverJohan Klokkhammer Helsing2019-01-231-1/+5
| | | | | | | | | | | | The plugins subdir which includes the platform plugins was not built without the feature wayland-server. Moves the checks inside the plugins folder to make it build. Also disables some tests that won't pass without the compositor API. Fixes: QTBUG-73169 Change-Id: Ie68badd2ff62ee544c31edaff7c732082e0a4115 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor tests: Test xdg-shell stable instead of unstable v5Johan Klokkhammer Helsing2019-01-234-77/+104
| | | | | Change-Id: Ib9dbad2e7312dab94cecbc1a14315dcb47c8c46a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* tst_WaylandCompositor::customSurface: Fix unused variable warningJohan Klokkhammer Helsing2019-01-211-0/+2
| | | | | | | Test custom surface destruction as well. Change-Id: Iad980858c3473e784cd0611136042bfacd09bddf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Test output related signals from QWaylandCompositorPier Luigi Fiorini2019-01-182-4/+21
| | | | | | | | | | | | These signals were never tested, in fact there was a bug where outputAdded was not emitted if a new output was added with QWaylandCompositor::setDefaultOutput() that was fixed in 9875a14daaec12ca65d3cb4a2aaf2c4582e6191d. Also while we are here, set the default output for TestCompositor. Change-Id: I21c2ff2f51f52b38f2dc992bcc9c03fd3071e82d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Skip flaky testsJohan Klokkhammer Helsing2019-01-181-0/+2
| | | | | | | | | It seems clients are sometimes sending more geometry events than needed, causing the tests to fail. Skip the tests for now to make builds pass again. Fixes: QTBUG-73130 Change-Id: Ia9f82ddd3561d84119dc4d9f8ef15ebc48964148 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Implement xdg-output-unstable-v1 version 2Johan Klokkhammer Helsing2019-01-171-0/+6
| | | | | | | | | | Adds handler for the new name event and updates tests accordingly. This means QScreen::name() will now typically return strings like: "VGA-1", "WL-1", "DP-2", "HDMI-A-1" instead of "Screen25", "Screen26", "Screen27" etc. Change-Id: I3d5748a2fd0d772e2344ac53f0ed808790a84ba5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Add tests for xdg-output-unstable-v1Johan Klokkhammer Helsing2019-01-173-0/+156
| | | | | Change-Id: I4b460bd1e5ac8541dcbf9afb2782187218d257e1 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Add wl_output testsJohan Klokkhammer Helsing2019-01-1715-248/+323
| | | | | | | | | Also removes overlapping old tests and adds a (currently failing) test for QTBUG-72828. Task-number: QTBUG-72828 Change-Id: Id93d5872ed1c4f181935c1e493e9d8d0ae9cfaf3 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Test for xdg surface window geometryPier Luigi Fiorini2019-01-153-0/+30
| | | | | Change-Id: I2f336a81682317b1f7dc939d911906b4db60a386 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Client: Test for xdg toplevel min and max sizeJohan Klokkhammer Helsing2019-01-153-1/+50
| | | | | Change-Id: I60605f494eebfde9a7737911eefe69a93041ced5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor: Implement support for the viewporter extensionJohan Klokkhammer Helsing2019-01-024-5/+426
| | | | | | | [ChangeLog][Compositor] Added support for the viewporter Wayland extension. Change-Id: I1d33652fab6ff18da4ae1ae3497f0ca43517420a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-222-5/+55
|\ | | | | | | | | | | | | | | Conflicts: README src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri Change-Id: I7cbbf39916821f0f1749e3ccab3151f68f4aa1ac
| * Compositor: Fix crash in QWaylandSurface::waylandClientJohan Klokkhammer Helsing2018-12-221-0/+27
| | | | | | | | | | | | | | | | Adds a test for customSurface which crashed without the fix. Fixes: QTBUG-72688 Change-Id: I30c50e474379c61b90b2dd294eae9a7c88c105a2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * tests: minor fixup in tst_WaylandCompositor::comparingModes()Gatis Paeglis2018-12-091-1/+1
| | | | | | | | | | | | | | This patch amends d25b3b7f1059d5561bce3efe7ea903ea76d4e888 Change-Id: I413818f6cd4a77062287265f3bcb5db6170fc4d2 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * Fix invalid QWaylandOutputMode comparison operatorJędrzej Nowacki2018-12-061-0/+23
| | | | | | | | | | | | Fixes: QTBUG-72288 Change-Id: I61fde92ea4275febbb4ec8c067280a4ca570d7c1 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * use new feature name xkbcommon_evdev -> xkbcommonGatis Paeglis2018-12-052-5/+5
| | | | | | | | | | | | | | | | | | The xkbcommon configure logic was refactored in qtbase/c3a963da1f9e7b1d37e63eedded61da4fbdaaf9a. For more details see the relevant commit. Change-Id: Ic1aa26846ab8266c589f6e92dc8b81aba36df58a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Client tests: Add simple test for mouse clickJohan Klokkhammer Helsing2018-12-131-0/+23
| | | | | | | | | | Change-Id: I2eb9bf8aa03e8df61a26d26da061f4030d8de0be Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Create a new type of mock compositor for client testsJohan Klokkhammer Helsing2018-12-1137-766/+2967
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of issues with the current client testing: - Adding new compositor functionality is cumbersome (need to add compositor send method, command, implementation, not to mention creating new wrapper objects. - Customizing available globals and their versions is not possible and would be hard to implement. I.e. how to test that functionality works with old and new versions of an interface? Handle globals being destroyed. We did this with wl_output, but it was painfully cumbersome. - Hard to verify that the compositor state is clean between tests. It is currently done in some tests, but requires boiler plate code which needs to be added and maintained for each test. - In general lots of boiler-plate for new tests. (We have to have separate tests as long as Qt has global/static state. I.e. if one shell extension has been initialized, we can't deinitialize and initialize another one, so tests have to be separate.) - Dispatching server events tied to the client event loop sometimes makes it hard to write tests without deadlocks. - Abstraction, encapsulation and automatic behavior that can't be disabled makes it hard to test low-level functionality like surface exposure. So, in an attempt to mitigate these issues, I wrote a new testing framework. - Compositor dispatch is running continuously in it's own thread, access to compositor state is guarded by a mutex on the compositor, locking this will make dispatching stop, so the test can safely access internals. Although a bit cumbersome at first this makes it much easier to directly use server protocol commands from the test itself, i.e. no need to create commands for every single thing we want to test. - The CoreCompositor::exec template method can accept a lambda that will be run with dispatching stopped. It can also return a value, conveniently letting us safely extract or modify compositor state from tests. - This framework also takes full advantage of the qtwaylandscanner, using wrapper classes for everything, reducing boiler plate considerably. - The compositor parts are designed to do as little as possible automatically, but still provide easy ways to enable common functionality, like releasing buffers automatically, configuring shell surfaces etc. - Compositor globals are pluggable, use add<GlobalClass>() and remove<GlobalClass>() to add new global interfaces. I.e. easy to create a compositor with or without data_device_manager for instance. - DefaultCompositor provides a sensible default set of functionality and convenience methods for most test-cases. Custom ones can still be made by inheriting from CoreCompositor directly instead or by removing or adding globals to DefaultCompositor. - Globals have an isClean() method. Implement it to verify that the client didn't leave any objects lying around from the previous test. CoreCompositor::isClean calls isClean on the globals so a single call is all that's needed. In short, we've traded mock compositor encapsulation and thread safety guarantees for less boiler-plate, easier and more convenient access to internals. Anything accessing compositor state should go into a exec() call, or through the wrapper macros QCOMPOSITOR_VERIFY and QCOMPOSITOR_COMPARE (or the TRY versions). I've also tried to make the compositor print warnings if compositor state is accessed in an unsafe way. The mock compositor is currently built once per test due to CI limitations (same thing as with the old tests). Change-Id: Ia3feb80ce175d3814292b7f4768a0cc719f8b0e8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Fix coordinate system inconsistenciesJohan Klokkhammer Helsing2018-11-161-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several properties were using pixel coordinates and surface coordinates without converting. [ChangeLog][Compositor] QWaylandSurface::destinationSize has been added which returns the size of the surface that will be displayed on the screen in surface coordinates. [ChangeLog][Compositor] Fixed a bug where QWaylandSurface::inputRegionContains would return true for some points outside surfaces with buffer scale > 1. [ChangeLog][Compositor] Fixed a bug which caused ShellSurfaceItems for surfaces with buffer scale > 1 to move too much when resizing interactively. It also gets rid of all calls to QWaylandSurface::size, which confusingly returns the size of the surface's buffer in pixel coordinates. Most properties now use destionationSize's surface coordinates consistently. Hopefully, QWaylandSurface::size can be renamed or removed in Qt 6. Change-Id: I007256a8df7759cf74fbfd51624fa1f90c083336 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Add fullscreen shell integrationPier Luigi Fiorini2018-11-058-1/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QPA plugin] Added support for fullscreen-shell unstable v1. The fullscreen_shell_unstable_v1 interface displays a single surface per output and it is used for nested compositors, where each output is rendered in a surface that is then displayed by the main compositor. For example weston could be the main compositor and a QML compositor could be launched as a client using this shell integration to display it inside weston. Change-Id: I037679a283ff03cb4bdf4b3fed59945090ec9250 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-305-9/+88
|\| | | | | | | Change-Id: I1d9281750b06f7584e55759994dc6fcbcc5b2455
| * Client: Don't spam expose eventsJohan Klokkhammer Helsing2018-10-261-0/+23
| | | | | | | | | | | | | | | | Only send expose event when the geometry actually changed. Change-Id: Ic06986ce5d11e0ff7a842303f57093b8ff25b9f6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
| * Client: Don't attach buffers to unexposed windowsJohan Klokkhammer Helsing2018-10-265-9/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBackingStore::flush is sometimes called with an unxeposed window, in that case, don't attach the buffer to the wl_surface immediately, as that causes protocol errors with xdg_shell. Flushed buffers are instead stored until we get the first configure event. [ChangeLog][QPA plugin][xdg-shell] Fixed a bug where buffers were sometimes attached and committed before the first configure event, causing protocol errors. Fixes: QTBUG-71345 Change-Id: If9409d97bd25f6b13940c56141920a664c349c8e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-202-3/+73
|\| | | | | | | Change-Id: I36baa27b69b755f81de9cda94113d338f06c34a1
| * Compositor: Emit signals after applying pending surface statev5.12.0-beta3Johan Klokkhammer Helsing2018-10-182-3/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Compositor] Fixed a bug where some signals on QWaylandSurface were emitted before all double buffered state had been applied. Restructures QWaylandSurface::commit so no signals are emitted until all state mutations are completed. Adds a test to confirm that pending state is applied at once. Also fixes opaqueRegion, which is documented to be double buffered as well, but the old implementation set it immediately. Change-Id: I1c4dfea7c83dd9ee84dc8c03e6d92e2924bf2fad Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Don't include system versions of wayland protocolJohan Klokkhammer Helsing2018-10-037-7/+7
|/ | | | | | | | | | | | | | | | | | | | | wayland-client.h and wayland-server.h includes protocol generated for the version of wayland.xml corresponding to the libwayland version. This becomes a problem when we want to support a version of wayland.xml that's newer than the system libwayland. The solution is to include wayland-client-core.h and wayland-client-server.h instead. These headers don't include any wayland-scanner generated code, so we can safely compile and link code generated against the version of wayland.xml that we ship. [ChangeLog] Code generated by qtwaylandscanner now includes wayland-client-core.h and wayland-server-core.h instead of wayland-client.h and wayland-server.h. This might break source compatibility for code using custom wayland extensions. Fixes: QTBUG-70553 Change-Id: Ice0cdb60ecc4f936acc0e158b96f7978549f62c1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Test empty and nullptr input regionsJohan Klokkhammer Helsing2018-09-261-1/+22
| | | | | Change-Id: Iddcf6cbddd74dc41d8c14b1da06f7e320de774b4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Add test for wl_surface::set_input_regionJohan Klokkhammer Helsing2018-09-261-0/+35
| | | | | Change-Id: I9b110647c054c897fa2a6d6fc6f392c981845f09 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Don't use members of wl_resourceJohan Klokkhammer Helsing2018-09-181-4/+4
| | | | | | | | | When we switch to only including core wayland headers, wl_resource will be an opaque type. Use the getters and setter functions instead. Task-number: QTBUG-70553 Change-Id: I7d84d48a4ee3586f231a331cd15716686dcee775 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove ifdefs for unsupported libwayland versionsJohan Klokkhammer Helsing2018-09-171-7/+0
| | | | | | | The ifdefs were for version 1.2.0. Change-Id: Ie58745c7cf4c0fba45bc5203d24e9913d3a8b8ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add missing Q_UNUSEDJohan Klokkhammer Helsing2018-09-141-0/+1
| | | | | Change-Id: I7e6b4460aac92cb9669ac1d0d0f4785a8444925d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Fix nullptr dereferences in fromResource functionsJohan Klokkhammer Helsing2018-08-291-1/+3
| | | | | | | | | If there was no resource for the given wl_resource*, don't try to dereference it. Change-Id: I3a27a5805699148bb26029e8b4179042c3c1117a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-281-0/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandxdgsurface.cpp src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h Done-with: Johan Klokkhammer Helsing <johan.helsing@qt.io> Change-Id: Ia39be6254a95af1c4efa831358cc06a697da3423
| * Skip flaky tst_WaylandClient::dontCrashOnMultipleCommits()v5.11.1Johan Klokkhammer Helsing2018-06-091-0/+1
| | | | | | | | | | | | | | | | Until we figure out the cause, just skip it. Task-number: QTBUG-68756 Change-Id: I70d84ddabae4ef9df834ff8a471dddeee97e18f9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-131-0/+12
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6596d1a127cc93e53ec30cd881da1810cb8076d5
| * Don't ask libwayland to set absurdly long window titlesJohan Klokkhammer Helsing2018-06-061-0/+11
| | | | | | | | | | | | | | | | It will cause libwayland to terminate the application. Task-number: QTBUG-68715 Change-Id: I1d1830453da224bec8bf4c5d6ab087c0e05328a8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Client tests: Ensure there are no leftover ivi_surfacesJohan Klokkhammer Helsing2018-05-281-0/+1
| | | | | | | | | | | | | | Similarly to what we do for xdg-shell v6. Change-Id: Id72d0af53c7bcee461b741341bf6b587ffe98522 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Add tests for xdg-shell v6 window geometryJohan Klokkhammer Helsing2018-06-074-0/+53
| | | | | | | | | | Change-Id: Ifb7a1d63a136349cd99d516e63732b4393967468 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client xdg-shell v6 tests: Fix dangling pointer usageJohan Klokkhammer Helsing2018-05-291-2/+2
| | | | | | | | | | | | | | Fixes some flaky tests Change-Id: Ifac7c95d12714d61afc37f879f4c70b2a7dbe0cf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Fix flakiness in xdg-shell v6 client testsJohan Klokkhammer Helsing2018-05-281-0/+4
| | | | | | | | | | Change-Id: I4b63edef6ea130ad7f7f294bf0903d84b8db4723 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-261-8/+0
|\| | | | | | | Change-Id: I8a1570eac9bbe418283522624002f8a03dd60c95
| * Client tests: Remove redundant cleanup testingJohan Klokkhammer Helsing2018-05-251-8/+0
| | | | | | | | | | | | | | | | | | | | | | We already have a QTRY_VERIFY(!compositor->surface()); in tst_WaylandClient::cleanup() which is already run after every test. The assertions from tests that are explicitly testing surface creation and destruction have not been removed. Change-Id: I21d574f5fe33d4e4c309dcfb2f50bde447238df2 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-191-1/+3
|\| | | | | | | Change-Id: I50c42c52a7b646317c7a87f364507fe232a55bf0
| * Fix tst_WaylandCompositor::sizeFollowsWindow on high-dpiJohan Klokkhammer Helsing2018-05-141-1/+3
| | | | | | | | | | | | | | | | The QWindow we use may have devicePixelRatio != 1 and that caused the test to fail. Change-Id: I3d248ed85cea521a3d543026a87f92c085116461 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Rename xdg-shell.xml to xdg-shell-unstable-v5.xmlJohan Klokkhammer Helsing2018-05-143-3/+3
| | | | | | | | | | | | | | | | | | Also change the protocol name in the xml file from xdg_shell to xdg_shell_unstable_v5 (similar pattern as v6) because qtwaylandscanner doesn't support the file name being different from the protocol name. Change-Id: I1d9edf7c8ca512e716284250a2b2bc13e205c33c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Fix QWaylandXdgShellV6Integration::handleKeyboardFocusChangedJohan Klokkhammer Helsing2018-05-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | The implementation was broken because it: 1. Didn't activate popups. 2. Activated toplevels with keyboard focus twice. 3. Tried to cast to xdg-shell-v5 classes, so windows were never deactivated. Change-Id: If492ebdbcd10a3214424f7bf6ac01e7ba8704bbf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Add acked configure support and implement it for xdg-shell v6Johan Klokkhammer Helsing2018-05-076-7/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem: The code in QWaylandWindow::setWindowStateInternal made many assumptions about how the shell surface responded to new window states, and when and if they were applied. Particularly: - The shell integrations support different subsets of Qt::WindowStates, so it doesn't make sense to map from states to setFullscreen, setNormal, etc. in QWaylandWindow because it really depends on the shell integration how it should be handled. - Some states are not supported/unknown on some shells and should immediately be rejected. - On some shells, particularly those where the current state is unknown, flags need to be resent even though they didn't change. - Should handleWindowStatesChanged be called immediately (client decides) or should it wait for a configure event (compositor decides)? I.e. the mState variable only makes sense for some shells. Furthermore, when state changes come from the compositors, some shell integrations require that a configure event is acked by the client and that the next committed buffer's size and content matches that configure event. Previously, we would just ack immediately and still send a buffer with the old size before a correct frame was drawn. i.e. sending incorrect acks, which would lead to protocol errors on some compositors. Additionally, QWaylandWindow::createDecoration() also assumed that windows should have decorations unless they are fullscreen. This is not always the case, particularly on ivi-application and probably on future shell integrations for embedded or tiling window managers etc. The Solution: The responsibility of mapping requested window states to Wayland requests have been moved to the QWaylandShellSurface implementation. QWaylandWindow now calls a new virtual, QWaylandShellSurface::requestWindowStates(Qt::WindowStates), instead of trying to be smart about it. The virtual getters and setters for window states have now been removed from the QWaylandShellSurface interface. It's now also the shell surface implementation's responsibility to call QWaylandWindow::handleWindowStatesChanged if and when it knows a new state is effective. QWaylandWindow::configure has been replaced with QWaylandWindow::applyConfigureWhenPossible(), which causes another new virtual, QWaylandShellSurface::applyConfigure(), to be called whenever we're free to resize and change the states of the next buffer (this is when states should be acked). This means that shells that use acked states need to store the pending states themselves, call applyConfigureWhenPossible(), wait for applyConfigure() to be called, call resizeFromApplyConfigure() and handleWindowStatesChanged(), and finally ack the applied state. Acked state for xdg-shell v5 and v6 has now been implemented, which also means we've now: [ChangeLog][QPA plugin] Implemented support for maximizing, minimizing, and setting fullscreen with xdg-shell unstable v6. [ChangeLog][QPA plugin] QWindow::isActive now follows configure events on xdg-shell unstable v6 (like v5). QWaylandWindow::createDecoration queries QWaylandShellSurface::wantsDecoration before creating window decorations, instead of using the previously unreliable QWaylandWindow::isFullscreen(). [ChangeLog][QPA plugin] Window decorations are now automatically disabled for ivi-application. The refactor also removes a couple of hacks: - QWindowSystemInterface::flushWindowSystemEvents() was called in QWaylandWindow::setWindowStates. Since this hack was introduced, the events now have oldState and newState members, and their values seem to make sense (ensured in the tests). - The hack for unminimizing on xdg-shell v5 in QWaylandWindow::createDecoration was not needed anymore. Finally, tests have been added for xdg-shell v6 to ensure that the right Wayland requests are sent, that we respond to configure events from the compositor, and that the Qt events and signals emitted on the client side make sense. Task-number: QTBUG-53702 Task-number: QTBUG-63417 Task-number: QTBUG-63748 Task-number: QTBUG-66928 Change-Id: Ib4c36b69105750f9dbdcc78adcf71e2e994cc70d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>