summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* | | Rename sendUnMaximized to sendUnmaximizedJohan Klokkhammer Helsing2016-07-121-2/+2
| | | | | | | | | | | | | | | Change-Id: I20add5c8b12e1345ce50c009d8bae80fde9806e1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Compositor: Rename shm to sharedMemoryJohan Klokkhammer Helsing2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | sharedMemory is much clearer and will increase the readability of the code and API. Change-Id: Ibb6d7424fa8d44a94a0f4ddf476a564eb235323f Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | | Rename xdg surface request<state> methods send<state>Johan Klokkhammer Helsing2016-05-311-7/+7
|/ / | | | | | | | | | | | | | | It could be confusing to have methods that cause Wayland events to be named request*. Change-Id: I6567f9e8fd9370e574516e97cd49858e2bf34829 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Fix test buildPier Luigi Fiorini2016-04-211-0/+2
| | | | | | | | | | | | | | Compiler cannot find wl_display_flush_clients() due to missing include. Change-Id: Ia703d100b9e509f7666580d50cca9b8ac44b656b Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Compositor-api: Test for xdg_shell::configure eventJohan Klokkhammer Helsing2016-04-183-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | Tests basic functionality for QWaylandXdgShell::sendConfigure as well as convenience functions and related edge cases (i.e. activated state should remain unchanged when setting maximized). Also verifies that ack_configure sets property values to the configure event values with the corresponding serial. Change-Id: Ifc7e107e46d25a529823360acc3befbf060e6f19 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Add basic tests for xdg-shell compositor APIJohan Klokkhammer Helsing2016-04-114-5/+114
| | | | | | | | | | | | | | | | | | | | | | | | Tests the following functionality: * xdg_shell can be found and bound using the registry * xdg_surfaces can be created * window geometry is handled correctly (not including subsurfaces) * app_id Change-Id: I76942da2b245f91fe567059e175fe9ceb98edb6a Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-081-0/+2
|\| | | | | | | Change-Id: I31f4c29c985301d28d5c8d0501761c7d4fb7fda6
| * fix namespaced buildOswald Buddenhagen2016-04-061-0/+2
| | | | | | | | | | Change-Id: I69c8fa49baebc29d8a22426394ce0a72627b9ad6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Rename compositor Shell to WlShellJohan Klokkhammer Helsing2016-04-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * QWaylandShell -> QWaylandWlShell * QWaylandShellSurface -> QWaylandWlShellSurface * QWaylandQuickShellSurfaceItem -> QWaylandQuickWlShellSurfaceItem * Shell -> WlShell (QML) * ShellSurface -> WlShellSurface (QML) * ShellSurfaceItem -> WlShellSurfaceItem (QML) This is done to avoid confusion with XdgShell and will hopefully help clarify that some of the examples only support wl_shell and not xdg_shell. Additionally, this makes "Shell" an available name in the compositor API, which may in turn enable the creation of a more general abstraction hiding the details of the shell backends (i.e. xdg_shell, wl_shell, and eventually ivi_shell). Change-Id: Iebac1f36505084bfaaea68838005d54db6c55e21 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Set socket name for TestCompositorJohan Klokkhammer Helsing2016-04-032-1/+1
| | | | | | | | | | | | | | | | | | | | | | Tests did not pass because WAYLAND_DISPLAY only affects clients, not compositors. Compositor display name can be set either using the command line argument "--wayland-socket-name" or QWaylandCompositor::setSocketName. The latter was chosen here. Change-Id: I524b5c92ec9959486373875850b4f192b62423e0 Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Fix incorrect function signature in compositor testJohan Klokkhammer Helsing2016-03-312-3/+3
| | | | | | | | | | | | Change-Id: I64174607a48b50c8371f53699568a96474dc10c6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com>
* | Test: Make compositor tests runnable with new APIErik Larsson2016-03-218-133/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix compilation errors and make all compositor tests runnable with the new compositor API. Some input handling tests are reworked so they are able to function with the new compositor API. Also make sure client and cmake tests are built even if not compiled with a wayland-compositor. Change-Id: I0f03e2c04f2736860f770b6100ccfa3300ff8da4 Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Updated license headersAntti Kokko2016-01-2011-187/+132
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: Ifa334d2d3487e413e90ba9f2bf377026076b2df1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Rename QtCompositor to QtWaylandCompositorJørgen Lind2015-09-101-1/+1
|/ | | | | | | enable building QtWaylandCompositor by default Change-Id: I7cf34052b304ca9fef55b7e30ef6a6367b5d75f1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Add a mechanism to delay unmapping of surfacesGiulio Camuffo2015-07-151-0/+3
| | | | | | | | | | When a client attachs a NULL buffer on a surface we may want to hang on to the old buffer for a bit, e.g. to do a hide animation. Add the QWaylandUnmapLock class to keep a surface mapped after an attach(0) request. Change-Id: I5d5be0b36410a76a58d2b68c1b2ac5e3b875a801 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>