summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* | 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>
* | 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-036-5/+6
|/ | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* | Add QWaylandSeat::sendKeyEvent(int qtKey, bool pressed)Johan Klokkhammer Helsing2018-04-276-8/+293
|/ | | | | | | | | | | | | | | | | | | | | | | | | Makes it possible to send keyboard events using the QML API: Button { onPressedChanged: seat.sendKeyEvent(Qt.Key_Left, pressed) } The wl_keyboard.key event requires a keyboard scan code, so in order to get this we iterate over all the keys in the current keymap checking which QtKey they map to, storing the results in a QMap which is reused by later calls to QWaylandKeymap::toScanCode. This also fixes a bug when sending QKeyEvents without a native scan code using QWaylandSeat::sendFullKeyEvent. (generated key events have no nativeScanCode). Now we try QWaylandKeyboard::toScanCode, and if unsuccessful we return with a warning instead of letting the assertion in QWaylandKeyboard fail. This also adds more thorough testing for the keyboard, including keymaps and checking that the events, including enter and leave, are actually received on the client side. Change-Id: I601b0c7d909071863abb146bd65a990215dcaff7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use override when applicableJohan Klokkhammer Helsing2018-02-285-5/+5
| | | | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-override. This adds the "override" keyword where it's possible and also removes the "virtual" keyword when redundant. Change-Id: I899950e5cf8782785d30a245a9c69c1720905d50 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use default member initialization for raw pointersJohan Klokkhammer Helsing2018-02-282-5/+5
| | | | | | | | Initialize to nullptr to prevent undefined behavior. Change-Id: I7753c0be77a886d62ecb1cd7b86fc8c98340b0b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-273-22/+12
| | | | | | | | | | | | | | | | | | | | clang-tidy -p compile_commands.json $file \ -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \ -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \ -header-filter='qtwayland' \ -fix Afterwards I ran search and replace on the diff to clean up some whitespace errors: - Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: ' - Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, ' - Replaced '\n\+\s*\n' with '\n' I also had to do some manual edits, because for some reason, this particular clang-tidy check doesn't trigger for some files. Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use nullptr instead of 0 or NULLJohan Klokkhammer Helsing2018-02-202-7/+7
| | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2018-01-311-1/+1
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-071-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/compositor/compositor_api/qwaylandquickitem.cpp Change-Id: Id2f49e8703a67daedcee66db83f006df828d9da0
| | * fix build without xkbcommon-evdevRaphael Freudiger2017-11-161-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I1a223b440a6678aebc04df49f62fedc382bd898b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-276-2/+212
|\| | | | | | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * | Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3Paul Olav Tvete2017-10-256-2/+212
| |\| | | | | | | | | | Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
| | * Fix crash after destroying view with mouse focusJohan Klokkhammer Helsing2017-10-186-2/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't emit QWaylandSeat::mouseFocusChanged with a destroyed QWaylandView. QWaylandPointer has been refactored to make it easier to follow enter and leave logic. A missing emit for buttonPressedChanged has been fixed as well. This also adds a test for pointer events to verify that setting mouse focus works and that the crash has been fixed. Task-number: QTBUG-63208 Change-Id: Id0c174a7b609dfd0152f3ae446dd51fd8befd554 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Compositor tests: Don't assume global numeric name == wayland object idJohan Klokkhammer Helsing2017-10-272-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Throughout the code we consistently and confusingly use the term, "id", instead of "numeric name" for Wayland globals. This is confusing because it's not the same as thing as wl_proxy_get_id returns, although the values frequently are the same because we typically bind to all globals in the order they are announced. So in this patch we turn m_outputs into a map with the numeric name and compare it with the numeric name we get in handleGlobalRemove. Change-Id: I0716bf66e12dbbf7b05b9ca5faa5d2beba297af5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | qtwaylandscanner: Remove globals when destroying wrappersJohan Klokkhammer Helsing2017-10-253-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When globals are destroyed on the compositor side, send the "global_remove" event and set the resource implementation to nullptr so all further requests are ignored. This also adds a compositor test to see if outputs are removed when they are deleted. Change-Id: Ib77a4c3d4c2c93283a14ac20f5964e2ce08a1d38 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Use QImage::sizeInBytes() instead of deprecated QImage::byteCount()Johan Klokkhammer Helsing2017-10-191-1/+1
| | | | | | | | | | | | | | | Change-Id: If3f21fc43d0118c1819d354c8ef43f1b79617c7b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Add missing field initializer for wl_registry_listener::global_removeJohan Klokkhammer Helsing2017-10-161-1/+2
| | | | | | | | | | | | | | | Change-Id: I237a324657f9932ec4396c87a96b66f7c19ac86a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | | Replace Q_NULLPTR with nullptrKevin Funk2017-09-262-2/+2
|/ / | | | | | | | | | | | | Change-Id: I9699a957430b8d3574ce29acb91b7ada9ea6209b Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* / Compositor: Add support for xdg-shell-unstable-v6Johan Klokkhammer Helsing2017-07-211-0/+48
|/ | | | | | | | | | This adds QML and C++ support for xdg-shell-unstable v6 on the compositor side. A couple of things are still missing for complete support, but can be added implemented later without breaking the API. Task-number: QTBUG-56174 Change-Id: I08d7c05aa4f40f00377d92f2519d89ab416daaf4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-254-10/+10
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/custom-extension/client-common/main.cpp src/client/qwaylandwlshellintegration_p.h src/client/qwaylandxdgshellintegration_p.h src/compositor/compositor_api/qwaylandquickoutput.h src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h Change-Id: Ic78c610ddf102b0a185294f625bbfcb9238b0f3c
| * Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-234-10/+10
| | | | | | | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Fix pointless asserts in compositor testsJohan Klokkhammer Helsing2016-12-231-6/+6
|/ | | | | | Change-Id: Ie5528c988a15d130056f1d2a3b3e858d78897ba5 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Use the feature system internallyLars Knoll2016-11-231-4/+1
| | | | | | | | | Get rid of almost all DEFINES += ... in the pro files, instead use the proper QT_CONFIG() macro to determine whether a feature is available. Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Move qtwayland over to use the new configuration systemLars Knoll2016-11-231-11/+3
| | | | | | | | | | | | | Re-use configuration results from qtbase where possible and move all pkg-config handling over to be done at configuration time. Since waylandclient and waylandcompositor are two independent libs, this required some duplication of features and libraries used by both in the configure.json files. Change-Id: I1f3ec56c85cb780324cc7634a3ad7951125853a0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add mode support to QWaylandOutputPier Luigi Fiorini2016-10-033-7/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Outputs usually have more than one mode, add an API to support them. When sizeFollowsWindow is true, modes are replaced by one with the window size and refresh rate. In that circumstance the mode changes when the window is resized. The sizeFollowsWindow property default value is no longer true. The setGeometry() method is gone as it doesn't make sense now, the setWidth() and setHeight() methods are now private slots to resize the resolution as the window resizes (and sizeFollowsWindow is true). Refresh rate is expressed in mHz rather than Hz just like the Wayland protocol. A compositor implementation may choose to add modes if it has access to hardware information, it will call addMode() for each mode and then invoke the setCurrentMode() method that sends the modes list to the client. The preferred mode is indicated with a boolean parameter to the addMode() method. Change-Id: Iffed4784ccef695c276ebd800172957f4cff3324 Task-number: QTBUG-49814 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Make QWaylandKeymap a QObjectJohan Klokkhammer Helsing2016-09-302-5/+6
| | | | | | | | | This makes it possible to use defaultSeat declaratively by allowing it to be uninitialized until the QWaylandCompositor::create has been called. Change-Id: I962cc7cc82a0bbc9240abb50cf92dee77e4a0ba6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* C++ API and tests for the ivi-application extensionJohan Klokkhammer Helsing2016-09-304-1/+192
| | | | | | | | | Note, this is only an implementation of the ivi-application extension, not ivi-controller which contains layer management interfaces. Task-number: QTBUG-53149 Change-Id: Ic5a31156de1768f846b714a9aee9bbf8a945cbbe Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Rename QWaylandView::attach() to bufferCommitted()Paul Olav Tvete2016-09-081-1/+1
| | | | | | | | | | The old name was wrong on two counts: first of all, the function is called on wl_surface.commit, not attach. Secondly, the imperative tense made it look like a function that can be called by the user. Change-Id: Icd872d430062e67154bd50ca7d79881ea9874152 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Rename the QWaylandXdg* classes to QWaylandXdg*V5Giulio Camuffo2016-09-051-26/+26
| | | | | | | | This frees the QWaylandXdg name for the hopefully coming stable version of xdg-shell. Change-Id: I9beb9b035c6497fb45bee5c9104485b564ca0619 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'qt/5.7' into 5.8v5.8.0-alpha1Liang Qi2016-08-2814-37/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compositor/compositor_api/qwaylandseat.cpp src/compositor/compositor_api/qwaylandview.cpp tests/auto/compositor/compositor.pro tests/auto/compositor/compositor/testinputdevice.cpp tests/auto/compositor/compositor/testinputdevice.h tests/auto/compositor/testinputdevice.cpp tests/auto/compositor/testinputdevice.h tests/auto/compositor/testseat.cpp tests/auto/compositor/testseat.h Change-Id: I98e045908dd964e5d4120bd35e71b8839c0d923a
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-2314-37/+42
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/compositor/compositor.pro tests/auto/compositor/compositor/compositor.pro Change-Id: Id9f3cf97ca3b600bdafba846908643ff0f8964b9
| | * Fix autotest directory structurePaul Olav Tvete2016-08-1914-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | The client and server parts are separate modules, so they need separate top-level directories under tests/auto. This also makes it easier to add new tests later. Change-Id: I393341b6f4e8fc3afa480653f3482192e002e425 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | | Rename QWaylandSurface::isMapped to hasContentJohan Klokkhammer Helsing2016-08-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was potentially misleading, since "mapped" is already used with a slightly different meaning in the Wayland protocol. In the protocol, mapped means that the surface should be rendered. The renamed property, on the other hand, is true if the surface has a buffer with contents attached and committed. In some cases this is not the same, i.e. the drag icon after dropping, or xdg_popups after popup_done. Change-Id: Idc359433c6130e3815de57b21d4edb13e318887d Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | | Compositor API: rename QWaylandInputDevice to QWaylandSeatJohan Klokkhammer Helsing2016-08-118-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name QWaylandInputDevice could be confusing and misleading: - A QWaylandInputDevice was not one input device, but a collection of many. - Classes that sounded like they should inherit from it did not, i.e: QWaylandKeyboard, QWaylandPointer and QWaylandTouch. - The Wayland protocol already has another term for this, which is seat. Change-Id: I9d9690d5b378075d9dddaeb8cf18395c7f47603e Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>