summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Slightly more minimal examplePaul Olav Tvete2016-07-121-7/+3
| | | | | | | | | We don't need the MouseArea, since we don't have a mouse cursor, and popups have been fixed to not require a magic item in the background. Change-Id: I78b029810bfa1b8764bc834aa0ed34affad71757 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Example cleanupPaul Olav Tvete2016-07-046-145/+145
| | | | | | | | Use sane class names and file names, just like we do in minimal-cpp. Change-Id: I17ef83711040a5507425721e695d64f43411fc4b Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Compositor: Add a minimal-qml examplePaul Olav Tvete2016-06-295-0/+163
| | | | | | | | As seen on blog.qt.io Change-Id: I217a01c331369541de36739dc40126887e252cc3 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* qwindow-compositor: avoid unused variable warningLaszlo Agocs2016-05-311-0/+1
| | | | | | Change-Id: Ie9091d6876ac834e204718fbc3258cee367ee292 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Merge "Merge remote-tracking branch 'qt/5.7.0' into 5.7" into refs/staging/5.7Frederik Gladhorn2016-05-272-5/+12
|\
| * Merge remote-tracking branch 'qt/5.7.0' into 5.7Paul Olav Tvete2016-05-262-5/+12
| |\ | | | | | | | | | Change-Id: I6236699846c922a79a1bd420a161392fd6572001
| | * fix example installOswald Buddenhagen2016-05-251-0/+3
| | | | | | | | | | | | | | | | | | Change-Id: I3d7b995ecbe2e06d9c87aea743d59ee551e1fae4 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| | * load(qt_plugin) at the endOswald Buddenhagen2016-05-251-3/+2
| | | | | | | | | | | | | | | | | | | | | amends 5b3f207ed after the merge to 5.7. Change-Id: Iabf29cbf0e24b3b02f19f5fb0cd5feb624169428 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | * Make example work for the non-streaming casePaul Olav Tvete2016-05-231-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't crash when buffer is shared memory. Don't set m_texture to 0 when not streaming. Use the new buffer when advancing. Use proper filtering when uploading to texture. Change-Id: I05bb12a05c7448d17d5292910f16b49e613b0ce0 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Revert "Add position property to QWaylandXdgPopup"Johan Klokkhammer Helsing2016-05-271-1/+1
|/ / | | | | | | | | | | | | | | | | | | This commit would have broken source and binary compatibility between 5.7.0 and 5.7.1. This reverts commit 20692ad15b8ac0c24b12d30609f061a740c87f23. Change-Id: Ic4156571889ec08a708e67c55d461d3052ce0ad0 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* / Add position property to QWaylandXdgPopupJohan Klokkhammer Helsing2016-05-241-1/+1
|/ | | | | | | | Store the position relative to the parent Change-Id: Iccae120b70e98388d18e4867e21a3a8c36ddd522 Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Create a general ShellSurfaceItem to avoid duplicationJohan Klokkhammer Helsing2016-05-207-113/+29
| | | | | | | | | | | | | | | | | | XdgSurfaceItem and WlShellSurfaceItem have been removed in favor of the more general ShellSurfaceItem. An XdgSurface or a WlShellSurface can be assigned to the shellSurface property of a ShellSurfaceItem and leaves open the possibility for additional shells. A shared base class for QWaylandXdgSurface and QWaylandWlShellSurface has been added which has a factory method for creating a QWaylandQuickShellIntegration for that shell implementation. The property "shellSurface" on the ShellSurfaceItem allows QML code to attach to signals regardless of whether it's a WlShell or XdgShell client. The pure-qml example has been updated to take advantage of this. Change-Id: I9d3427586e100d6c44a24f319dd8e1486ff062ee Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Fix buildJohan Klokkhammer Helsing2016-05-201-1/+1
| | | | | Change-Id: I8f1338fa6ed807ac309f2b6d7a8265c1bae144b8 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-194-4/+12
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/qml-compositor/qml-compositor.pro examples/wayland/server-buffer/compositor/compositor.pro Change-Id: Ie6fa21dfbdb71f33e0a4d29d34a824048cf00864
| * fix example installsv5.6.1-1v5.6.1Oswald Buddenhagen2016-04-285-8/+21
| | | | | | | | | | | | | | | | | | this actually includes removing the install targets for the sources - this is automated now. Change-Id: I736958d70baabfa4db816abbfc50acacbf2ee23c Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Move QWaylandClientExtension out of namespacePaul Olav Tvete2016-05-193-11/+0
| | | | | | | | | | | | | | | | The class name already has a QWaylandClient prefix. We don't need QtWaylandClient:: in addition. Change-Id: I42f16d43fe414e3388dfdb924e96d9fc2b0b4ba9 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Fixed eglStream compositingDominik Holland2016-05-183-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating the eglStream from the fd we also need to create the texture and call stream_consumer_gltexture. Otherwise the wayland client can't create the wayland client surface. Fixed the qwindow-compositor example to use the texture associated to the QWaylandBufferRef when compositing a EXTERNAL_OES target. QML compositing only works when QSG_RENDER_LOOP is set to basic as we need to generate a texture from the gui thread. As the texture is created by the bufferintegration it might end up in a different gl context than the quick item using it. The texture is also deleted together with the buffer, which prevents the use of the texture afterwards. Both problems need to be fixed in follow up commits. Task-number: QTBUG-50850 Change-Id: Ifec67bbe9e4b2a680c871dc4aced37b71b7b6f80 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Rename QWaylandExtension to QWaylandCompositorExtensionPaul Olav Tvete2016-05-182-3/+3
| | | | | | | | | | | | | | | | Since we have QWaylandClientExtension Change-Id: Ie8d60322c8e730bda651e06ed5db0fe1359d946e Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Fix example build dependencyPaul Olav Tvete2016-05-121-0/+2
| | | | | | | | | | | | Change-Id: I5efcfdbee1bcc60d88a693226d234ad585078edb Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Move subsurface test application to tests/manualPaul Olav Tvete2016-05-027-445/+0
| | | | | | | | | | | | Change-Id: Ib69594d0c69238311d417f7b2954529c10da1ff6 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Automatically initialize the quick extension objectsGiulio Camuffo2016-04-296-30/+9
| | | | | | | | | | | | | | | | | | Instead of writing "Component.onCompleted: initialize()" for every extension the compositor has, let them call that automatically. Change-Id: I0b499a38c2b475dc9a7ef27cbacebef19b196dbf Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Update the virtual keyboard importJan Arne Petersen2016-04-261-1/+1
| | | | | | | | | | | | | | Qtvirtual Keyboard dropped the enterprise from its import names. Change-Id: Ie7bfda14d77d0e72fa25ef85d9762a8ca62a87ab Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | QML API for xdg-shellJohan Klokkhammer Helsing2016-04-264-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exposes QWaylandXdgShell and QWaylandXdgSurface as QML types, along with a new QWaylandXdgSurfaceItem. All of this mirrors the implementation of wl_shell closely. The biggest difference is how resize is handled. There is now some duplication in the window chrome implementation of the pure-qml compositor. This may be improved by refactoring the existing API for shell extensions. Change-Id: I4f2ceff7e0462034cd295a27c3eefea457cc9b96 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Add window manager extension to the pure-qml examplePier Luigi Fiorini2016-04-252-0/+14
| | | | | | | | | | Change-Id: I50a5ab6156fabac93bcc706bb49fb7dc92cf342d Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Add QML api for client side extension.Erik Larsson2016-04-215-1/+208
| | | | | | | | | | | | | | | | | | | | | | This makes it simple to use client-side extensions in QML. The only thing that the user needs to do is register the extension class using qmlRegisterType() and the use the extension in QML. Also adds simple QML example which uses client-side extension. Change-Id: I2db99861d97c7bca5cfdbf86ba3a8ccc50fb24b0 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Move drag icon relative the cursor hotspot positionErik Larsson2016-04-214-10/+12
| | | | | | | | | | | | | | | | | | | | Instead of placing the drag icons top-left corner at the cursors hotspot the drag icon is moved so it will be placed correct relative the cursor hotspot. This will makes the drag feeling more realistic. Change-Id: I8d60ae1b7788accb9034575983417abae4c58c1a Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Fix undefined behavior in qwindow-compositorJohan Klokkhammer Helsing2016-04-192-1/+9
| | | | | | | | | | | | | | | | | | m_xdgSurface and m_xdgPopup were left uninitialized. Fixes a crash when resizing wl_shell clients. Change-Id: I8f4b05e395ac6088d9f40bbe9cca6141ee12dfc9 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Fix text-input support for new APIJan Arne Petersen2016-04-185-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update text input support to upstream text-input protocol v2 from wayland-protocols. Remove support for input-method protocol for now. Map text-input protocol on compositor side to the Qt input method API, this allows to use any qt platform input method on compositor side (especially qtvirtualkeyboard). Add support for qtvirtualkeyboard to pure-qml example. Implement all missing functions of the text-input protocol. Change-Id: I597451ff65454a63dff86026b6a8d1ffbe07ce02 Done-with: Zeno Endemann <zeno.endemann@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Simplify ShellSurfaceItem creationv5.7.0-beta1Johan Klokkhammer Helsing2016-04-113-11/+7
| | | | | | | | | | | | | | | | | | | | | | Use onShellSurfaceCreated instead of onCreateShellSurface. A QWaylandWlShellSurface is no longer created in QWaylandWlShellSurfaceItem::componentComplete Change-Id: I7a0dbbacddc17ab32ed0e4d16e717fcefb221947 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com>
* | Create a fallback shellSurface in wl_shell::get_shell_surfaceJohan Klokkhammer Helsing2016-04-112-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes QWaylandShellPrivate::shell_get_shell_surface behave similarly to QWaylandCompositorPrivate::compositor_create_surface. First, a signal is emitted letting a compositor implementation create its own subclass of QWaylandShellSurface if desired. If it's not created, a plain QWaylandShellSurface is created instead. It also makes the API more consistent, as the creation of shell surfaces now mimick the creation of surfaces and xdg surfaces. qwindow-compositor has been updated to take advantage of the new API Change-Id: I7c7262dd253dc37843e8e471a4ead5f6e87b0ced Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Rename compositor Shell to WlShellJohan Klokkhammer Helsing2016-04-057-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | qwindow-compositor: Fix regression when clearing popupsJohan Klokkhammer Helsing2016-03-311-3/+2
| | | | | | | | | | | | | | | | Clearing the popup list erroneously got moved inside the foreach loop. Change-Id: I8696c1c4281207230f5afa3a05d22881d93794c6 Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Initial compositor support for xdg-shell wayland extensionJohan Klokkhammer Helsing2016-03-244-14/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xdg-shell is an extension to the wayland protocol providing functionality suited towards traditional desktop environments. Most of the examples from Weston now require xdg-shell, ivi-shell or some other custom extension. In order for our compositor-api to support those examples and many real-world applications, we needed a compositor implementation of xdg-shell. This commit adds a class QWaylandXdgShell, along with QWaylandXdgSurface and QWaylandXdgPopup. These clases are used almost exactly like the corresponding QWaylandShell* variants. qwindow-compositor has been updated to use the new functionality. qwindow-compositor now only sets focus on surfaces that have a role. weston-terminal was crashing because we set keyboard focus on the cursor surface. Keyboard focus handling has been slightly changed. Most of the functionality has been moved from QWaylandKeyboard::setFocus to QWaylandInputDevice::setKeyboardFocus. This is done in order to track where the keyboard focus should have been, in case the input device (seat) does not currently have a keyboard capability. If a keyboard capability is later set on the input device, its focus will automatically be set to the value stored in QWaylandInputDevice. The reason for the change in keyboard focus handling is that we need to know if an xdgSurface has keyboard focus in order to know whether to send the Activated state in configure events. The Activated state tells the client to draw itself as having focus (i.e. title bar not grayed out). Change-Id: I1b1ca9a4223e87f5ade1e0f4c975979a400c38cb Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Fix crash in qwindow-compositor when setting hidden cursorJohan Klokkhammer Helsing2016-03-191-1/+1
| | | | | | | | | | | | | | | | | | Clients can request null as the cursor surface in order to hide the cursor. Added a null pointer check so it doesn't crash. Change-Id: I9a0081ea9edd74c504bd55e385a6854024ab0c8a Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Simplify client-side API for Wayland extensionsErik Larsson2016-03-183-27/+7
| | | | | | | | | | | | | | | | | | | | | | This simplifies the client-side API for Wayland extensions by introducing QWaylandClientExtension/QWaylandClientExtensionTemplate classes. These classes takes care of the initialization of the extension if it matches the interface name. Change-Id: I7c4fb34563563af4be072cdebda54954b79cddbe Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | qwindow-compositor: Fix cursor not being set for mapped surfacesJohan Klokkhammer Helsing2016-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a client sent a set_cursor request with a mapped surface, qwindow-compositor did not call updateCursor until the next time the surface was committed, which resulted in cursors with incorrect pixmaps and hotspots. This is solved by adding a check to see if the surface in set_cursor is already mapped, and if so, update the cursor immediately. The issue did not affect Qt clients, since commits are sent after set_cursor. Change-Id: I8b2555b68e9517e04f5bb8c5affe09d84bc97c0c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Fix broken qml import in server-buffer exampleJohan Klokkhammer Helsing2016-03-021-1/+1
| | | | | | | | | | Change-Id: Iae5fdae99a2e81b246feca2b7b511e794b23f253 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Add minimal-cpp compositor example to .pro fileJohan Klokkhammer Helsing2016-02-181-0/+1
| | | | | | | | | | | | Change-Id: Id874e426ba3e598a582ed74d4ed096dfae38603c Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com>
* | Add surface roles backGiulio Camuffo2016-02-115-6/+6
| | | | | | | | | | | | Task-number: QTBUG-49809 Change-Id: Id62ddea68c89b6999b66d3df8eeeffd858ae844f Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Subsurface implementation, with C++ APIPaul Olav Tvete2016-02-044-6/+90
| | | | | | | | | | | | | | | | | | This adds support for subsurfaces to QWaylandCompositor and QWaylandSurface. Task-number: QTBUG-49809 Change-Id: I2fa9ee4dcd1f48a2a28dab536f9cd6edc716e42b Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* | Remove unused slot from qwindow-compositorLaszlo Agocs2016-02-032-6/+0
| | | | | | | | | | Change-Id: Iaa4e0cb06ddce396d2c91c7b10eff57bba556a32 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* | Link with the wayland-client libraryPaul Olav Tvete2016-01-141-0/+6
| | | | | | | | | | Change-Id: I888f7289285a57a7c0a4a01054b4f691b178ad73 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | A minimal c++-based compositorPaul Olav Tvete2016-01-127-0/+468
| | | | | | | | | | | | | | No input handling. Change-Id: Ie35f8ad5ff7317c83b9b76bc5c45adaca8bdb6fb Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Pure QML example: add shortcut to quitShawn Rutledge2015-12-111-1/+5
| | | | | | | | | | | | | | | | | | | | On the eglfs platform, there is no obvious way to exit back to a console, so it's too easy to get stuck in this example and need to reboot via ssh or some such. Ctrl-Alt-Backspace is the historical way of exiting from an X11 or Weston session, so we use it here. Change-Id: Ibe93acb0a81ef47384d5449760f25ad6e4cac8d8 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Merge branch 'wip-compositor-api' into devPaul Olav Tvete2015-12-0257-1634/+2339
|\ \ | | | | | | | | | | | | | | | | | | This introduces the new compositor API, removing the old API (which was never officially supported). Change-Id: I1dc01f0fb4edc749e34ed8356e56ad87d7d64913
| * | Compile fix for namespaced Qt buildsPaul Olav Tvete2015-11-281-0/+4
| | | | | | | | | | | | | | | | | | Change-Id: Ie23f7c01331d5e52dcf30952d7ad9ade6ef5a5e0 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
| * | Fix copyright headersPaul Olav Tvete2015-11-0914-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | Old copyright headers were accidentally used for some new code. Change-Id: I0230d350e59701bc6b383c7c8151d52e34e8e75a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
| * | Add install targets for new examples.Paul Olav Tvete2015-11-045-1/+16
| | | | | | | | | | | | | | | Change-Id: Ibb4ae57d82a86d5fc74679c628a5c7a9b100f71d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * | Texture fix for examplePaul Olav Tvete2015-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | Make it show colors other than black... Change-Id: I0d0ef374d18c1dfbd4f1734d2d0cdcfbc2f36186 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * | Null pointer check for examplePaul Olav Tvete2015-11-041-2/+6
| | | | | | | | | | | | | | | | | | | | | The documentation says that defaultOutput() is initialized later. Change-Id: I3dcc6c9dc7395c7986721235333388614928347c Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>