summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandcompositor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add logging category for hardware integrationsPaul Olav Tvete2018-09-201-0/+1
| | | | | | | qLcWaylandCompositorHardwareIntegration, "qt.waylandcompositor.hardwareintegration" Change-Id: I977ccc53f51b24b58acee08c424b806868550eac Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Change compositor categorized logging namespacePaul Olav Tvete2018-09-201-1/+2
| | | | | | | | | [ChangeLog][Compositor] Add new categorized logging namespace "qt.waylandcompositor" and rename "qt.compositor.input.methods" to "qt.waylandcompositor.inputmethods" Change-Id: Id861e527e3eb8582fdc96f8497fad0cba0766847 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor: Rename addSocketFd to addSocketDescriptorJohan Klokkhammer Helsing2018-09-171-3/+3
| | | | | | | | Generally we prefer not to use abbreviated names. It now also matches what's in other Qt modules. Change-Id: I67d54961bebf93760780be54761c6122069f1e1d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add missing Q_UNUSEDJohan Klokkhammer Helsing2018-09-141-0/+1
| | | | | Change-Id: I41ff947ed5fd18d19058583ed3da51225d353af9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: emit outputAdded if setDefaultOutput adds an outputJohan Klokkhammer Helsing2018-08-291-2/+4
| | | | | | | | | [ChangeLog][Compositor] Fixed a bug where outputAdded was not emitted if a new output was added through QWaylandCompositor::setDefaultOutput. Change-Id: I875badd340d6241fda7a5fce9b3bba8ca8b2f560 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-141-0/+1
|\ | | | | | | Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
| * Handle subsurfaces added before QWaylandQuickItem createdPaul Olav Tvete2018-08-071-0/+1
| | | | | | | | | | | | | | | | This makes gstreamer and Firefox work with QML-based compositors. Task-number: QTBUG-69643 Change-Id: Iaddaeb7dc3493a262993eecc5ea0b6ce076b4044 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Fix nullptr dereference in event filterJohan Klokkhammer Helsing2018-08-091-26/+35
| | | | | | | | | | | | | | | | Could happen if events were received before the default seat had been initialized Change-Id: I09d97a4b747b75b5c580386f7e0d45715274ed8b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: add API for using existing socket fd'sMatt Hoosier2018-06-251-0/+56
|/ | | | | | | | | | | | | This adds functionality to allow system-level control over handing out file descriptors for sockets. In particular, it allows writing socket- activated compositors. [ChangeLog][Compositor] Added API for installing a socket on which bind() and listen() have already been called into the event dispatch loop. This facilitates socket-activated compositors. Change-Id: I620f5ad0a3c3c5c4ecb937004230dcd024df8f69 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Use default member initialization for raw pointersJohan Klokkhammer Helsing2018-02-281-2/+2
| | | | | | | | 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-271-9/+0
| | | | | | | | | | | | | | | | | | | | 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-201-4/+4
| | | | | | | | 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-33/+32
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Fix broken documentationJohan Klokkhammer Helsing2017-12-051-33/+32
| | | | | | | | | | Change-Id: I16f11c32c861908e34de0cb28c8ad51378aa6e61 Reviewed-by: Martin Smith <martin.smith@qt.io>
| * Fix various documentation errors for QML methods and signalsJohan Klokkhammer Helsing2017-11-231-1/+1
| | | | | | | | | | Change-Id: I9461fae92ec3d41e4f9e866a6a4fa7554a309ecd Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-0/+1
|\| | | | | | | Change-Id: If69178e53ede77032d1a1e298e416fd69dd053f4
| * Emit change signal when assigning socket name automaticallyJohan Klokkhammer Helsing2017-11-061-0/+1
| | | | | | | | | | Change-Id: I6f92d5731e5f53fef37c442fd56e7e8260d8c4cb Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-271-2/+2
|\| | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * Compositor documentation: Specify return types for objectsJohan Klokkhammer Helsing2017-10-171-2/+2
| | | | | | | | | | | | Change-Id: I9ff21c7d8b085be8fbcb102b5284ec1ac5dfb40b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-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>
* Fix licensingv5.9.0-beta4Jani Heikkinen2017-05-041-13/+16
| | | | | | | | | | Currently tests are licensed under GPL-EXCEPT, examples under BSD and src under LGPL so replase old license headers with new & proper ones. Also remove old & unused license files Task-number: QTBUG-57147 Change-Id: Ia6a738798736c275dc309ccfa5b627dc2178d241 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up draganddrop and clipboard featuresPaul Olav Tvete2017-03-231-0/+8
| | | | | | | | | | | | Don't assume that no-draganddrop implies no-clipboard. Introduce a new private feature wayland-datadevice which contains the common functionality. This feature cannot be controlled independently, but is automatically disabled when both clipboard and draganddrop are disabled. Change-Id: I6aac09c7ee524e3b11f0a1caa4a6c62fc3f1d10f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-231-1/+1
| | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use the feature system internallyLars Knoll2016-11-231-10/+11
| | | | | | | | | 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>
* Documentation: Remove tech preview statusJohan Klokkhammer Helsing2016-10-031-2/+2
| | | | | | | | | Remove "preliminary" and add "since 5.8". Also remove notice from readme about the API being in tech preview. Change-Id: I4ef1ffa4e23661f5a1e28c9e3207678be5b0435c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Refactor buffer handlingPaul Olav Tvete2016-10-011-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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 QWaylandKeymap a QObjectJohan Klokkhammer Helsing2016-09-301-7/+20
| | | | | | | | | 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>
* Emit signals for compositor propertiesPier Luigi Fiorini2016-09-201-1/+24
| | | | | | | | Allow property binding from QML and add a created property that is set to true after the initialization. Change-Id: I923eedc793660b4ea18372eb0182eae0bcca436d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'qt/5.7' into 5.8v5.8.0-alpha1Liang Qi2016-08-281-10/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Doc: Language editVenugopal Shivashankar2016-08-241-1/+1
| | | | | | | | | | | | | | Removed a misplaced article. Change-Id: Ic78170156569b75d9ff577c8a34fd1bda48859c3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Doc: Language editsVenugopal Shivashankar2016-08-171-11/+9
| | | | | | | | | | | | | | Task-number: QTBUG-53147 Change-Id: I353cf18b9661b5eb2371072f8091dc890fc7fcf0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
* | Compositor API: rename QWaylandInputDevice to QWaylandSeatJohan Klokkhammer Helsing2016-08-111-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'qt/5.7' into devPaul Olav Tvete2016-08-041-1/+1
|\| | | | | | | Change-Id: Ib22055ac52c0bb36081242948c72332db4e5ac64
| * Doc: several minor link issues in QtWaylandNico Vertriest2016-08-021-1/+1
| | | | | | | | | | | | Change-Id: I9e656b02e1b820e2257d95948650c541656192b4 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
* | Rename createSurface and similar signalsJohan Klokkhammer Helsing2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | * 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-021-4/+2
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/minimal-qml/main.qml Change-Id: Ic34029a6aa77f2b359f40258a05421d82efd5b37
| * Fix the key code of key events when control is pressedGiulio Camuffo2016-07-041-4/+2
| | | | | | | | | | | | Change-Id: I51a57a32d8263e663a48dac15881d685359bc91d Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | Migrate to public QOpenGLTextureBlitterLaszlo Agocs2016-07-291-1/+1
| | | | | | | | | | Change-Id: I481ebdaf9e5749a57223a91ab3a231ca40af059a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compile with -no-openglJohan Klokkhammer Helsing2016-07-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Compositor: Rename shm to sharedMemoryJohan Klokkhammer Helsing2016-07-111-4/+4
| | | | | | | | | | | | | | | | 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 QT_COMPOSITOR_WAYLAND_GL to QT_WAYLAND_COMPOSITOR_GLJohan Klokkhammer Helsing2016-07-011-6/+6
| | | | | | | | | | | | | | | | Qt Wayland Compositor is the name used for the module elsewhere. Change-Id: I28813d50f1aed86f49a31aa54d27ea4ed2770d6a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-301-2/+2
|\| | | | | | | | | | | | | Conflicts: src/compositor/extensions/qwaylandxdgshellintegration.cpp Change-Id: I3e8666d0c2fd047f12daeb94b2c967c646576ed9
| * Doc: minor link issues QtWaylandNico Vertriest2016-06-211-2/+2
| | | | | | | | | | | | Change-Id: I5ea47a8252f2915696d02052686f2c802a81878c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Rename QWaylandWindowManagerExtension to QWaylandQtWindowManagerPier Luigi Fiorini2016-05-311-3/+3
|/ | | | | | | | | | | | | | | | | | * 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 private headers to _p.hPaul Olav Tvete2016-05-191-2/+2
| | | | | | Change-Id: I0f0d1bd8efabc39325eec7dba4166ae0bccbf6ff Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Mark the QtWaylandCompositor API as \preliminaryPaul Olav Tvete2016-05-121-0/+2
| | | | | Change-Id: I85e3a6dd98496005c63a88bc0218bc94301692ba Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Fix text-input support for new APIJan Arne Petersen2016-04-181-0/+2
| | | | | | | | | | | | | | | | 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>
* Add API to grab a surface's contentGiulio Camuffo2016-04-181-0/+54
| | | | | | | | This patch adds a new QWaylandSurfaceGrabber class. The user can use it to grab a surface's content, and get a QImage with the data. Change-Id: I25dd72a8ba39201cd91addbfc976b93ca1e05112 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Initial compositor support for xdg-shell wayland extensionJohan Klokkhammer Helsing2016-03-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add automatic socket name detection in compositorErik Larsson2016-03-211-15/+21
| | | | | | | | | | | | | | | The compositor automatically finds a free socket name using wl_display_add_socket_auto. Also fix the order in which the compositor uses --wayland-socket-name or the content of the socketName property. The documentation states the content of the socketName property should be used before the content of --wayland-socket-name. The commit also removes the reference to the WAYLAND_DISPLAY environment variable from the docs. Change-Id: I33dff4e4627d95f5894a5a1e2f308d747f449691 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>