summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add a multi-screen compositor exampleJohan Klokkhammer Helsing2016-10-107-0/+367
| | | | | | | | | This example shows how shell surfaces can move across outputs in order to create traditional multi-monitor desktop functionality. Change-Id: Ie7c0aa1dc47c0c1a944dffcce5237dee92785396 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Example compositor for the ivi application extensionJohan Klokkhammer Helsing2016-10-045-0/+172
| | | | | | | | A compositor with two areas, clients are maximized on one of those areas depending on their ivi surface id. Change-Id: I2dbb20b47e38680e14465d3a4a8147d64817de63 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add mode support to QWaylandOutputPier Luigi Fiorini2016-10-039-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Refactor buffer handlingPaul Olav Tvete2016-10-016-44/+22
| | | | | | | | | | | | | | | | | | | | | | | | | We cannot support bindToTexture() functions. On some platforms the texture is provided by the driver. Therefore, the HW integration must always provide a texture. This has the added bonus of unifying the two separate code paths that were introduced when EGLStream support was added. Add a separate buffer manager that owns all buffers. Don't destroy buffer objects on release. The client will probably attach them again later. Also, release shm buffers immediately after uploading to texture (needs to be documented that image() will not work afterwards). Make the old SurfaceBuffer class into an abstract base class, so we can store state in the buffer class instead of having to map from the wl_resource in each buffer integration. Move the shared memory buffer handling into a separate subclass. Change-Id: I81e471d13c92913d31ea1efe487f93fa908b5e0c Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Make the custom extension example more interestingPaul Olav Tvete2016-09-3011-95/+470
| | | | | | | Define a protocol that does something visible. Change-Id: I29133eeffbb2c98a61ee59b241dcf6a6a0f543cb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Follow surface isMapped property renamePier Luigi Fiorini2016-09-301-2/+2
| | | | | | | | With b7075b72200b7b087e2c34fa449737970981ccea the QWaylandSurface::isMapped property was renamed to hasContent but this example wasn't updated. Change-Id: I9b13fa3a17ffcc3d6d8be19b59552f61b25bb64b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor: Base shell classPier Luigi Fiorini2016-09-302-3/+4
| | | | | | | | | | | | Standard shell class with focus policy shared by all protocol implementations. The automatic focus policy gives focus to windows automatically as they are created, while the manual policy allows a compositor to decide what to do. Change-Id: Ica71271174b30e28217e31c53f1c8dd576752c5e Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor: Add a spanning screens exampleJohan Klokkhammer Helsing2016-09-275-0/+201
| | | | | | | | | This example shows how one application can be displayed full screen spanning two screens. The intended use case is for running applications with lots of scrolling content, such as a web browser. Change-Id: Icba2715aa7ccd79c9d44c7e1d621bfdd9e51e66c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor API: Add closeAllPopups method to QWaylandWlShellJohan Klokkhammer Helsing2016-09-202-18/+12
| | | | | | | | | | The WlShell implementation now matches xdg shell. Also adds a convenience method to QWaylandWlShell to get all popups. QWaylandWlShellIntegration and qwindow-compositor uses this new API. Change-Id: Ibfe3323ad7f56d43379785582b9be6801905a485 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Simplify custom-extension examplePaul Olav Tvete2016-09-0816-70/+50
| | | | | | | | | | | | | Don't confuse people by creating the extension inside a platform plugin. It's only necessary when modifying Qt's default behaviour, and we're not going to teach that in this example. Also remove the load/unload extension logic from the qml example. Don't make people believe that they have to use a loader. Change-Id: Id263bb7d77fba176bfb8b6843a6ece9a0a203754 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-055-30/+30
| | | | | | | | 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-281-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * qwindow-compositor: remove drag icon before droppingJohan Klokkhammer Helsing2016-08-111-1/+3
| | | | | | | | | | Change-Id: Ief93b5e79d3a51e4d20387357ad2abe15bf1a695 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Remove extensions array from the minimal QML compositor exampleJohan Klokkhammer Helsing2016-08-231-10/+8
| | | | | | | | | | Change-Id: Ia89c19b741754473d680de6e8f5ee558176b992b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | Remove QWaylandView from the QML APIPaul Olav Tvete2016-08-223-3/+3
| | | | | | | | | | | | | | | | | | | | QWaylandQuickItem already encapsulates the view. Also rename the confusing 'discardFrontBuffers' property to 'allowDiscardFrontBuffer' Change-Id: Ibd74ad54bfe3d5187c2ed91ff0378b45e144e109 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Rename QWaylandSurface::isMapped to hasContentJohan Klokkhammer Helsing2016-08-225-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-116-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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 createSurface and similar signalsJohan Klokkhammer Helsing2016-08-036-13/+13
| | | | | | | | | | | | | | | | | | | | | | * createSurface -> surfaceRequested * createXdgSurface -> xdgSurfaceRequested * createXdgPopup -> xdgPopupRequested * createShellSurface -> wlShellSurfaceRequested * shellSurfaceCreated -> wlShellSurfaceCreated Change-Id: I715a927242130d7504955002a6a64a2bac516d46 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-027-152/+148
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/minimal-qml/main.qml Change-Id: Ic34029a6aa77f2b359f40258a05421d82efd5b37
| * 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>
* | Migrate to public QOpenGLTextureBlitterLaszlo Agocs2016-07-292-2/+2
| | | | | | | | | | Change-Id: I481ebdaf9e5749a57223a91ab3a231ca40af059a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compile with -no-openglJohan Klokkhammer Helsing2016-07-201-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QtWayland has not compiled without OpenGL for a while. This patch fixes the compilation issues and removes the old config variable, "QT_WAYLAND_GL_CONFIG" and instead checks for the presence of "opengl" in "QT_CONFIG". A new define is also introduced, QT_WAYLAND_COMPOSITOR_QUICK, because it may eventually be possible to use create a QtQuick compositor without OpenGL. Task-number: QTBUG-54322 Change-Id: Ica7b3b320212d4ae1f8b1053725b73c83739c73c Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Rename sendUnMaximized to sendUnmaximizedJohan Klokkhammer Helsing2016-07-121-1/+1
| | | | | | | | | | Change-Id: I20add5c8b12e1345ce50c009d8bae80fde9806e1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: make the extensions property list optionalPaul Olav Tvete2016-07-123-48/+42
| | | | | | | | | | | | | | | | | | | | Extensions will now automatically add themselves to their parent if they are not inside an extensions [ ... ] array. Change-Id: I26c7f7c2ee023595eb4cd2496dd56e212f05329c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Compositor: Rename shm to sharedMemoryJohan Klokkhammer Helsing2016-07-111-2/+2
| | | | | | | | | | | | | | | | 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>
* | Adjust for hotspot position inside WaylandCursorItemJohan Klokkhammer Helsing2016-07-113-6/+6
| | | | | | | | | | Change-Id: Ide6605b7bd05f739976ed603c19e030ec74d2a2a Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Rename enableWSCursor to windowSystemCursorEnabledJohan Klokkhammer Helsing2016-07-114-4/+4
| | | | | | | | | | | | | | What WS stood for may not have been obvious. Change-Id: Ib2a3f566e4e49d8be0c14c4937e7356b51718e44 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Rename bufferLock to bufferLockedJohan Klokkhammer Helsing2016-07-042-2/+2
| | | | | | | | | | Change-Id: Ia3e0fa53579ee0d28b1d6b7384b9c6def2761a2b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-305-0/+163
|\| | | | | | | | | | | | | Conflicts: src/compositor/extensions/qwaylandxdgshellintegration.cpp Change-Id: I3e8666d0c2fd047f12daeb94b2c967c646576ed9
| * 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>
* | Add QML popup support for xdg_shellJohan Klokkhammer Helsing2016-06-151-1/+7
| | | | | | | | | | Change-Id: I5b35ff3b1c6c2dc884b52e6f077c0f2bb2db68a2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-111-0/+1
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwldatadevice.cpp Change-Id: I2f555f969ec36b3e9b4123d758ae4176c5c90164
| * 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>
* | Add position property to QWaylandXdgPopupJohan Klokkhammer Helsing2016-06-071-1/+1
| | | | | | | | | | Change-Id: I29c48ae9c44fc5601200a6bb6f6a7dbd9c8baba3 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Rename QWaylandWindowManagerExtension to QWaylandQtWindowManagerPier Luigi Fiorini2016-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * QWaylandWindowManagerExtension become QWaylandQtWindowManager * WindowManager become QtWindowManager Follow naming convention already established for other extensions like QWaylandWlShell and avoid confusion that might arise with a name as generic as WindowManager. Use QWaylandClient rather than wl_client. Also the Wayland protocol definition has been renamed to qt-windowmanager.xml Change-Id: I941621ce229327c21eff9e80c7e92205cc60e8eb Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Rename xdg surface request<state> methods send<state>Johan Klokkhammer Helsing2016-05-311-4/+4
|/ | | | | | | | 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>
* 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>