summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: fix wayland/texture-sharing/custom-compositorPeter Seiderer2020-04-061-0/+4
| | | | | | | | | | | | | | | | | | Fixes: main.cpp:83:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’? 83 | *glInternalFormat = GL_RGBA8; | ^~~~~~~~ | GL_RGBA4 main.cpp:120:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’? 120 | *glInternalFormat = GL_RGBA8; | ^~~~~~~~ | GL_RGBA4 Task-number: QTBUG-83304 Change-Id: I0515f3303b08c405d162986e280e9a7bd35e28f7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove usages of deprecated APIs of QWheelEventSona Kurazyan2019-08-283-4/+8
| | | | | | | | | | | - Replaced the usages of deprecated QWheelEvent::delta() and QWheelEvent::orientation() with QWheelEvent::angleDelta(). - Removed the tests for deprecated APIs. Task-number: QTBUG-76491 Change-Id: I2f9a53d3236bce8ba6cee66ec1b0b933d50518aa Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor: Add xdg-output unstable v1 supportPier Luigi Fiorini2019-08-263-3/+21
| | | | | | | | | | | | | | | | | | | | | | | We already have a client-side implementation in the QPA plugin, and now we add the server-side implementation. In order to have a nice declarative API, we let users create a XdgOutputV1 instance and then associate it with the zxdg_output_v1 object when it is requested by the client. If the user forgets to create XdgOutputV1 beforehand we post an error to the client. To anticipate protocol version 3, we send zxdg_output_v1.done when we send wl_output.done. The multi-output example is extended using this protocol. [ChangeLog][Compositor] Added support for xdg-output unstable v1 Wayland extension. Change-Id: I1ec5913d8330cc01d7d634d05a289f4dc8b4fd22 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'qt/5.13' into devPaul Olav Tvete2019-08-161-1/+3
|\ | | | | | | Change-Id: Ief5f30fc1dbd0e6531b19e723057b06e9bd419b4
| * Merge remote-tracking branch 'qt/5.12' into 5.13Paul Olav Tvete2019-08-141-2/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compositor/configure.json sync.profile tests/auto/auto.pro Change-Id: Ia6d1512aa9ad49ac7f92ae88f23026dc0ee2ccc5
| | * Fix the build when libs didn't get builtLiang Qi2019-08-121-2/+6
| | | | | | | | | | | | | | | Change-Id: I641a1a80edd0861049d079422eef28b095fc26b3 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* | | Fix build with Qt 6 and strict API deprecationsSimon Hausmann2019-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | QList's swap(int i, int j) is deprecated in favor of swapItemsAt() and when building with QT_VERSION == 6 it's removed from the API. Change-Id: I5513d4d879a85369040864cfc9c058f0f3665648 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | | Compositor: some parts depends on opengl feature instead of moduleLiang Qi2019-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This amends 8663de3fa789d8b8e10c5580b37f6eb3beac9ed6. Task-number: QTBUG-76439 Change-Id: If62252fb63c3261dfd23574830f0f60b99c1d854 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Eradicate Q_FOREACH loops [1/2]: trivial casesMarc Mutz2019-05-212-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this patch, we port Q_FOREACH loops to C++11 ranged-for loops. All cases are trivial in the sense that either the argument is already const or is trivially marked as const, either by qAsConst(), or, in the case of rvalues, by storing to a const auto temporary first. In addition, all loop bodies are clear enough to confirm that the container we iterate over is not changed under iteration. This does not exclude cases where a loop is prematurely exited just after calling a modifier on the container, as that is safe, if not especially elegant. Change-Id: I87a63f07797437d421567d60e52305391a3c4f21 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devJohan Klokkhammer Helsing2019-05-071-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylanddisplay_p.h src/client/qwaylandwindow.cpp Change-Id: I50eb5c83a8b81e4bdb032b68d41f429b17d0a74d
| * | client: rework input method handlingGatis Paeglis2019-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing solution was parsing compose tables on startup, it is better to lazy initialize the compose table/state on a first key press, instead of doing it on an application startup. This logic is inside of the compose input plugin. The existing code did not utilize correctly how Qt handles complex text input. It used libxkbcommon-compose APIs to compose user input and then passed the same input again to QPlatformInputContext (from QWaylandInputDevice::Keyboard::sendKey), which was erroneous. This also means that code was forcing "xkb compose", and did not respect QT_IM_MODULE at client-side. From commit that added compose key handling (57c4af2b18c0fb1d266b245a107fa6cb876b9d9e): "We should expand on it in the future to handle things like resetting the compose state on text field switching". This is now handled by properly utilizing Qt IM framework. Converted QWaylandInputDevice::Keyboard::sendKey into a class member function to avoid adding one more arg (mXkbContext) to the already long argument list. That whole function should be simplified, but that is out-of-scope for this patch. The reworked code uses qxkbcommon support library to reduce code duplication between platforms and to unify behavior. Some users might mistakenly think that this patch introduces a regression with Qt on KDE, but it is actually a KWin/Wayland compositor bug: https://bugs.kde.org/show_bug.cgi?id=405388 The work around on KDE is to use QT_IM_MODULE at client-side to select input method, as KWin compositor over the wire supports only the qtvirtualkeyboard module. Setting this envvar is not someting out of the ordinary for users on Linux. Input method handling at compositor-side is new feature and clearly not very well supported yet. Task-number: QTBUG-65503 Change-Id: Ie511d950396fa2fb6cbe6672996cee9791f3ab11 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Compositor: Don't require OpenGL to build the QML APIsJohan Klokkhammer Helsing2019-04-041-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Compositor API] The compositor API now works without OpenGL support. This makes the compositor API work with shared memory clients only. If OpenGL clients connect they will currently punch holes in the compositor window, but fixing that is out of scope for this patch. Fixes: QTBUG-74896 Change-Id: I6c1ba82f28ba9edecf380e471124e15d16f9518e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | New texture sharing protocol and infrastructurePaul Olav Tvete2019-03-2818-2/+759
|/ / | | | | | | | | | | | | | | | | | | | | | | | | This adds a higher level protocol on top of the server buffer extension, providing an easy way for Qt Quick applications to use the shared textures. [ChangeLog] Added protocol and Qt Quick image provider for sharing textures in graphics memory between compositor and multiple clients. Task-number: QTBUG-73822 Change-Id: Idc41b3479d6ca37be35d9ccd7b89e9994ff17f8f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-106-2/+7
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5f8ba96b550b6d326a097fce33863caed01c05d1
| * C++ examples: Delay compositor initialization until GL is readyPaul Olav Tvete2019-01-096-2/+7
| | | | | | | | | | | | | | | | | | | | When running with xcb_egl, the platform plugin's native interface is not always ready immediately after the QGuiApplication constructor is done. Calling QWaylandCompositor::create() at the time of initializeGL() makes sure that everything is ready. Change-Id: I9e5e434ff85b92a45caddfd393439a4ffe3bcdc6 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Fix coordinate system inconsistenciesJohan Klokkhammer Helsing2018-11-165-7/+7
|/ | | | | | | | | | | | | | | | | | | | | | | 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>
* Add server buffer integration using Linux dma-bufPaul Olav Tvete2018-09-211-2/+2
| | | | | | Fixes: QTBUG-70494 Change-Id: Iaa4990fe9d39a1f9fb81f5e5f19039aa2e52dcac Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Don't use members of wl_resourceJohan Klokkhammer Helsing2018-09-181-1/+1
| | | | | | | | | 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>
* server-side-decoration example: Implement window movePaul Olav Tvete2018-08-211-12/+23
| | | | | Change-Id: I5e876338a37dc3126ce8b7950d2eef58ec09c07d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor API: Add xdg-decoration unstable v1 supportJohan Klokkhammer Helsing2018-08-176-0/+227
| | | | | | | | And add an example with server-side window decorations. Task-number: QTBUG-69934 Change-Id: Ic3984b50cf7574cae5135dea51eb4b1c80bb45a7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add mouse and keyboard handling to minimal-cpp examplePaul Olav Tvete2018-08-165-18/+168
| | | | | | | ...and do some other minor cleanups. Change-Id: I7fe2c70d8b2de37cee5cc114cc0148d31821e10f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor API: Add xdg-shell stableJohan Klokkhammer Helsing2018-08-156-10/+24
| | | | | | | | | | | | | | | [ChangeLog][Compositor API] Added APIs for xdg-shell stable. Code copied from the V6 implementation with suffixes and prefixes removed. Otherwise a few minor edits, such as renaming xdg_shell to xdg_wm_base, and handling the anchor and gravity edges no longer being bitfields. Examples that used v6 have been updated to use stable instead, or, in some cases, to support both. Task-number: QTBUG-66784 Change-Id: Ia619b478a938fdcd9b47af8a8df2d7fcc4406204 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* qwindow-compositor: rename input to seatJohan Klokkhammer Helsing2018-08-091-6/+6
| | | | | | | This should have been done when we renamed from inputDevice to seat. Change-Id: I4a296322fc79a6dd6d30ee2b1c97c3a818cc568e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* hwlayer-compositor example: Remove xdg-shell unstable v5 supportJohan Klokkhammer Helsing2018-08-071-1/+0
| | | | | Change-Id: Iac4189584286995f2d03d16fe4edfe74367e0645 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Multi-screen example compositor: Upgrade to xdg-shell unstable v6Johan Klokkhammer Helsing2018-08-072-4/+4
| | | | | Change-Id: Ifdee719cd79516a36ba9282abac9c59afacf542f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-2/+5
|\ | | | | | | Change-Id: I7947816edbfef4e07d488d25122cfd9a969436db
| * Make sure we don't use deleted memory in examplePaul Olav Tvete2018-08-041-2/+5
| | | | | | | | | | | | | | | | | | | | The view has a pointer to a QOpenGLTexture that is owned by the buffer. Don't keep using that pointer after the buffer has deleted it. Task-number: QTBUG-69384 Change-Id: I48fd813e0dcb74db04d217238be7b0b6b345fc11 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-281-1/+2
|\| | | | | | | | | | | | | | | | | | | | | 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
| * Doc: Add missing dots (qtwayland)Paul Wicking2018-06-191-1/+2
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: I02ba2e659d21923934dab970af23856b45ff1570 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Revamp overview-compositor exampleJohan Klokkhammer Helsing2018-05-281-16/+23
| | | | | | | | | | | | | | | | | | | | | | - Switch to xdg-shell v6 - Use autoCreatePopupItems - Follow QML coding conventions - Support for screen dpr != 1 Task-number: QTBUG-60661 Change-Id: Iad9547c0d7529c0fce8e9303c55b5c0b0ee0e27b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Add overview-compositor to compositor examples .pro-fileJohan Klokkhammer Helsing2018-05-281-0/+1
| | | | | | | | | | Change-Id: I613888a5d5693586be3221861a70cdad087283ae Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Revamp spanning-screens exampleJohan Klokkhammer Helsing2018-05-281-48/+27
| | | | | | | | | | | | | | | | | | | | | | | | - Switch to xdg-shell v6 - Use autoCreatePopupItems - Follow QML coding conventions - Remove redundant compositor bindings - Support for screen dpr != 1 Task-number: QTBUG-60661 Change-Id: I9447aca2e21732de4361c0cf53a2f09216a75dc8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Revamp pure-qml exampleJohan Klokkhammer Helsing2018-05-184-70/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | - Use a ListModel to manage shellSurfaces - Remove obsolete/deprecated extensions (QtWindowManager, XdgShellV5) - Remove no-ops (onSurfaceRequested created a default surface) - Remove dead code (primarySurfaceArea, output property on Window) - Add comments - Follow coding conventions (formatting, order of object attributes etc.) Task-number: QTBUG-60661 Change-Id: I4ffd2c4b5deff1d801a25efa96300fc5851d3359 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Automatically create ShellSurfaceItems for popupsJohan Klokkhammer Helsing2018-05-183-16/+4
|/ | | | | Change-Id: I5e6b0147c4f1bb73ff3a8f5512d21884f962a89a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove waylandclient-private dependency from custom-extension exampleJohan Klokkhammer Helsing2018-04-255-8/+5
| | | | | | | | We really only depend on gui-private. Change-Id: Ic774cf94d8d94194c26d3852206ecff488948196 Reviewed-by: Drew DeVault <qt@cmpwn.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Make the minimal-cpp example a real compositorPaul Olav Tvete2018-03-214-22/+23
| | | | | | | | | Use the ivi-application protocol, since a compositor without a shell is not really a proper compositor. Use the IVI id to determine the position instead of generating a random position for each frame. Change-Id: I2ede824c656e4c2ef88117cf0f0b8d27ad80b6e2 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Use override when applicableJohan Klokkhammer Helsing2018-02-282-3/+3
| | | | | | | | | | 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-285-7/+7
| | | | | | | | 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-2713-39/+21
| | | | | | | | | | | | | | | | | | | | 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-205-10/+10
| | | | | | | | 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>
* Compositor API: Add support for hardware compositingJohan Klokkhammer Helsing2018-02-096-0/+246
| | | | | | | | | | [ChangeLog][Compositor] Add a tech preview for a plugin-based hardware layer API and a VSP2 implementation (for Renesas R-Car M3 and H3). Task-number: QTBUG-64600 Task-number: QTBUG-64604 Change-Id: Ia4abfb6343cf4f006ba408d293ec9464cd6f31b7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor examples: Remove unused dependencies on private APIsJohan Klokkhammer Helsing2018-01-162-2/+2
| | | | | Change-Id: Iee33e9fe065693a615e1d18d3d03d5a7618e3f75 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Fix outdated FDL license headerLiang Qi2017-12-051-4/+4
| | | | | Change-Id: Ie664c28c21880af15452f091a977a5bedec3d73a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-202-3/+2
|\ | | | | | | Change-Id: If69178e53ede77032d1a1e298e416fd69dd053f4
| * pure-qml example: fix position of XdgShellV6 popupsShawn Rutledge2017-11-201-2/+1
| | | | | | | | | | | | | | Menus open up at the right place this way. Change-Id: Iae18fdcefe33356e9e9ee105b9f5c597bb6c896b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * Update to new QRandomGenerator APIThiago Macieira2017-11-031-1/+1
| | | | | | | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add overview-compositor exampleJohan Klokkhammer Helsing2017-11-156-0/+252
| | | | | | | | | | Change-Id: Id6243dbe9d1c5f872006264938c735bc2a779517 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Fix broken minimal-qml exampleJohan Klokkhammer Helsing2017-11-061-2/+2
| | | | | | | | | | | | | | | | The example didn't work because XdgShellV6 was added in 1.1 and we imported 1.0. Also, xdgSurface is the shell surface in the toplevelCreated signal. Change-Id: Idf64745e39d50a6b2f8df696ba890890ef14af50 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-2716-42/+291
|\| | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3Paul Olav Tvete2017-10-2516-42/+291
| |\ | | | | | | | | | Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2