summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandsurface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Use correct module identifiers in QML documentationTopi Reinio2023-06-081-17/+17
| | | | | | | | | | | | | | | | Multiple \qmlproperty, \qmlmethod, and \qmlsignal topics used an incorrect QML module identifier. With upcoming changes to QDoc these will start to generate documentation warnings. Fix the commands to either use the correct identifier, or remove the identifier as QDoc is capable of resolving the parent QML type without it. In passing, fix a documentation linking issue. Pick-to: 6.6 6.5 Change-Id: I5a562acc5f135d36c036ea1c1cc56218c23833b8 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* compositor: Fix warning on damage/damage_buffer mixEskil Abrahamsen Blomfeldt2022-12-071-25/+20
| | | | | | | | | | | | | | | | | The damage() request has been deprecated in favor of the damage_buffer() request, which is the one we use in Qt 6 as long as the version is 4 or higher. See change: 314fd6db51277224cdc799b039ef79db1101f5cd. However, eglSwapBuffers() will in some drivers still send the old request, causing us to get a mix of incompatible requests, since they are in different coordinate systems. We need to store these separately so that we can apply them both correctly once we get a commit. Fixes: QTBUG-108765 Change-Id: I9bbe0c87731847a4fa1927957dfd8945bd49c474 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-101-4/+4
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Ia64c6615ee81f7ad5d0658449b0ee347c3db8c29 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Use SPDX license identifiersLucie Gérard2022-06-101-29/+3
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I106d3a5d1a7b96250380b6f51a48f3b19d10e4d9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtWaylandCompositor: includemocsLiang Qi2022-06-011-0/+2
| | | | | | | Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-103295 Change-Id: I2311465d5341fc5902981d80ab0a117dd2df002d Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Doc: Fix QWaylandSurface::isOpaque property documentationTopi Reinio2022-04-061-1/+1
| | | | | | | | | | The \property command accepts no type, only the name of the property. Task-number: QTBUG-102185 Change-Id: Ia779a8c4097c7f4f1d1080b0e75114cea947578a Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Use opaque render list when client content is opaqueEskil Abrahamsen Blomfeldt2022-02-171-3/+31
| | | | | | | | | | | | | | | If the client says it's fully opaque through the set_opaque_region request, we can disable blending for the item and potentially improve performance a little bit. [ChangeLog][QtWaylandCompositor] The compositor now respects the opaque region set by the client and no longer applies blending or overdraw for fully opaque windows. Fixes: QTBUG-100373 Change-Id: Iaa68fbf1f086d926c9c1867d981a63810f4ca855 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Introduce new qt-shell and an API for custom shellsPaul Olav Tvete2021-12-021-4/+59
| | | | | | | | | | | | | | | | | | | | | | Adds a new API for writing custom shell extensions. This API is supported, but semi-public. Binary compatibility is not guaranteed. Also adds qt-shell, a new shell that maps directly to the QWindow API, and provides functionality that Qt provides on other window systems, such as absolute window positions and window activation. This shell is not intended for use on the desktop. This is a squashed commit of a development branch consisting of approximately 60 changes. Contributors: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Paul Olav Tvete <paul.tvete@qt.io> Task-number: QTBUG-94330 Task-number: QTBUG-91542 Change-Id: I419b6bd8179fe03e4da47d328c7ff4b4795b8a91 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Docs: Add "instantiates" keywordsKai Uwe Broulik2021-04-261-0/+1
| | | | | | | | | Document what the corresponding C++ class for any given QML item is, like it's done in Qt Declarative. Pick-to: 5.15 Change-Id: I015565f88cb457f1e73dd7c2c54edff3505db395 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support wl_surface.damage_bufferPaul Olav Tvete2020-07-071-1/+36
| | | | | | | | | Add compositor support for wl_surface.damage_buffer requests. This also required updating wl_compositor to version 4. Fixes: QTBUG-74927 Change-Id: I887ed04e60fe14ecce7df6a517950b0091e2ad54 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2019-10-311-1/+2
|\ | | | | | | | | | | | | Conflicts: src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp Change-Id: I42733f5ad9429a5d2ff6c804eb1f3f2d50f50811
| * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-261-1/+2
| |\ | | | | | | | | | Change-Id: Ie283d8861ecf11f21621ab18efdc780143559b52
| | * Compositor: Fix crashes when destroying uninitialized surfacesJohan Klokkhammer Helsing2019-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened when running qmlplugindump for QtWayland. [ChangeLog][Compositor] Fixed a crash when destroying WaylandSurfaces and WlShellSurfaces which had not yet been initialized. Change-Id: Ia35cc1ccddc6146453d4dbba0ffd41a012a526e3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-261-15/+5
|\| | | | | | | | | | | Change-Id: I25e65c392612cc1c379bd408adb60559b1d8a498
| * | Update QtWaylandCompositor license headers to GPL 3v5.14.0-beta2Paul Olav Tvete2019-10-161-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As announced on the mailing list, QtWaylandCompositor licensing is changing to GPLv3: https://lists.qt-project.org/pipermail/development/2019-October/037666.html Change-Id: I4bdc1aa5914e53ac760acc2b6453355af636baa9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Compositor: Remove deprecated QWaylandSurface::sizeJohan Klokkhammer Helsing2019-10-031-25/+1
|/ / | | | | | | | | | | | | | | | | [ChangeLog][Compositor] WaylandSurface.size referred to size in buffer (not surface) coordinates which was confusing and has now been removed. Use the bufferSize or surfaceSize properties instead. Change-Id: Id435b58237e0425b241584f3d2e6ae04b534413d Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Compositor: Expose QPointF version of inputRegionContainsJohan Klokkhammer Helsing2019-09-161-1/+2
| | | | | | | | | | | | | | | | | | QWaylandSurface::inputRegionContains(const &QPointF) was added in a patch release. Expose it here and start testing it. Task-number: QTBUG-77457 Change-Id: I9e5e487e1d93a2b1873a7e219eed9ef6b0a418b5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Johan Klokkhammer Helsing2019-09-161-0/+18
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylanddatadevice.cpp src/client/qwaylandinputcontext.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandwindow.cpp src/compositor/compositor_api/compositor_api.pri src/compositor/compositor_api/qwaylandquickitem.cpp Change-Id: Ice0d8c7d869c9c46113d6ee6ba3adf895a71d58f
| * Compositor: Fix various input-related rounding errorsJohan Klokkhammer Helsing2019-09-051-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPointF::toPoint (which is what the QPoint versions of the events use internally) uses qRound, which is not the right kind of rounding to use with the QRegion we use for the input region. This switches to use QPointF variants instead of QPoint wherever possible, and then the correct conversion (with qFloor) is done once in the new QPointF version of QWaylandSurface::inputRegionContains(). The compositor inputRegion test has now been updated to test the new API. [ChangeLog][Compositor] Fixed various rounding errors related to touch and mouse input. Fixes: QTBUG-77457 Change-Id: Ife2365abd56a239c34eee91310ab0e698a50d4ff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Add missing \since doc tags for inhibitsIdle propertiesJohan Klokkhammer Helsing2019-09-131-0/+2
| | | | | | | | | | Change-Id: I42056cdc57e9b7093f17825502103f1f434850d5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Compositor: Add idle-inhibit unstable v1 protocolPier Luigi Fiorini2019-08-161-0/+23
| | | | | | | | | | | | | | | | | | | | Allows disabling of screen blanking on a per-surface basis. [ChangeLog][Compositor] Added support for idle-inhibit unstable v1 Wayland extension. Change-Id: I3cd392f9e1bb3604691f2a496579aad3b87383b6 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Fix crash when destroying QWaylandSurfaces with multiple viewsJohan Klokkhammer Helsing2019-06-121-1/+2
| | | | | | | | | | | | | | | | | | This was a regression when we switched from foreach to range-based for. QWaylandViewPrivate::markSurfaceAsDestroyed causes QWaylandSurfacePrivate::views to mutate. Change-Id: I38881998a5480b84387062cd70ae5ec321320a24 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Eradicate Q_FOREACH loops [1/2]: trivial casesMarc Mutz2019-05-211-4/+4
|/ | | | | | | | | | | | | | | 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>
* Doc: Fix minor link issuesNico Vertriest2019-04-251-3/+1
| | | | | Change-Id: I42bca2a6d5a687217c3dde9bd80394bc95e361f8 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* docs: Fix qdoc warningsKavindra Palaraja2019-03-271-0/+17
| | | | | | | * Added some missing documentation Change-Id: I214b108c084aeff501bed85845153aa80fa61e6d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* [docs] Fix qdoc warningsKavindra Palaraja2019-03-191-3/+4
| | | | | Change-Id: I57e89057a238064e1270d036b656d261b85e50e7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Add missing version information for new APIJohan Klokkhammer Helsing2019-02-271-0/+4
| | | | | Change-Id: Ieec4a97d901f236d2cec003d8b35e2f95b1b2aea Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-221-1/+0
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/3rdparty/protocol/qt_attribution.json src/client/qwaylandintegration.cpp Change-Id: I475889f2817c7094b68a2948fdd34ddf8b0c486f
| * Remove stray surfaceDestroyed() declarationPier Luigi Fiorini2019-01-181-1/+0
| | | | | | | | | | Change-Id: I1a23d6ab5a455603990db269446c15a012c0f879 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Implement support for the viewporter extensionJohan Klokkhammer Helsing2019-01-021-1/+39
| | | | | | | | | | | | | | [ChangeLog][Compositor] Added support for the viewporter Wayland extension. Change-Id: I1d33652fab6ff18da4ae1ae3497f0ca43517420a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-221-0/+13
|\| | | | | | | | | | | | | | | Conflicts: README src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri Change-Id: I7cbbf39916821f0f1749e3ccab3151f68f4aa1ac
| * Compositor: Fix crash in QWaylandSurface::waylandClientJohan Klokkhammer Helsing2018-12-221-0/+13
| | | | | | | | | | | | | | | | Adds a test for customSurface which crashed without the fix. Fixes: QTBUG-72688 Change-Id: I30c50e474379c61b90b2dd294eae9a7c88c105a2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Add convenience for converting wl_resource * to wrapper typesJohan Klokkhammer Helsing2018-11-211-3/+4
| | | | | | | | | | Change-Id: Ieb2f9706ac707ff878165d3f9001e4a28b8ff1ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Add QWaylandSurface::bufferSize and deprecate sizeJohan Klokkhammer Helsing2018-11-161-8/+36
| | | | | | | | | | | | | | | | | | | | | | | | Size is confusingly returning the surface size in buffer coordinates and not surface coordinates. Create a new property bufferSize and deprecated size in order to make it less ambiguous. [ChangeLog][Compositor] QWaylandSurface::size has been deprecated. Use bufferSize or destinationSize instead. Change-Id: I7985e4cc1b8d627f922680c1800d2687d710d7b3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Fix coordinate system inconsistenciesJohan Klokkhammer Helsing2018-11-161-6/+42
|/ | | | | | | | | | | | | | | | | | | | | | | 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>
* Compositor: Emit signals after applying pending surface statev5.12.0-beta3Johan Klokkhammer Helsing2018-10-181-46/+38
| | | | | | | | | | | | | | | | [ChangeLog][Compositor] Fixed a bug where some signals on QWaylandSurface were emitted before all double buffered state had been applied. Restructures QWaylandSurface::commit so no signals are emitted until all state mutations are completed. Adds a test to confirm that pending state is applied at once. Also fixes opaqueRegion, which is documented to be double buffered as well, but the old implementation set it immediately. Change-Id: I1c4dfea7c83dd9ee84dc8c03e6d92e2924bf2fad Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove ifdefs for unsupported libwayland versionsJohan Klokkhammer Helsing2018-09-171-9/+0
| | | | | | | The ifdefs were for version 1.2.0. Change-Id: Ie58745c7cf4c0fba45bc5203d24e9913d3a8b8ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Fix nullptr dereferences in fromResource functionsJohan Klokkhammer Helsing2018-08-291-1/+3
| | | | | | | | | If there was no resource for the given wl_resource*, don't try to dereference it. Change-Id: I3a27a5805699148bb26029e8b4179042c3c1117a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor: Add documentation for WaylandSurface::surfaceDestroyedv5.11.0-beta4v5.11.0-beta3Johan Klokkhammer Helsing2018-03-271-0/+13
| | | | | Change-Id: Ia4118d5242e6bf6dfb703db76e53ea09fbc25041 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Compositor: Add documentation for WaylandSurface::childAddedJohan Klokkhammer Helsing2018-03-271-0/+12
| | | | | Change-Id: Ibcaa85986764545128a18981e17dac9838606f69 Reviewed-by: Martin Smith <martin.smith@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-18/+2
| | | | | | | | | | | | | | | | | | | | 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-2/+2
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Fix various documentation errors for QML methods and signalsJohan Klokkhammer Helsing2017-11-231-2/+2
| | | | | | | | | | Change-Id: I9461fae92ec3d41e4f9e866a6a4fa7554a309ecd Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Remove QWaylandExtendedSurface* from the private compositor APIJohan Klokkhammer Helsing2017-12-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes QWaylandExtendedSurface, QWaylandSurfaceExtensionGlobal. The only code touching these classes was QWaylandQuickSurface::setClientRenderingEnabled(), but that code was only useful if QWaylandSurfaceExtensionGlobal had already been instantiated. The extension is a remnant from the past, and since no examples or tests are using the extension, it's safe to remove it. Change-Id: Ife202cb035c836b73a7c03985f5bf3be0abebc3d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-271-1/+1
|\| | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * Compositor documentation: Specify return types for objectsJohan Klokkhammer Helsing2017-10-171-1/+1
| | | | | | | | | | | | Change-Id: I9ff21c7d8b085be8fbcb102b5284ec1ac5dfb40b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-051-0/+4
|\| | | | | | | Change-Id: I7c3c1fb4535fe13b34a1b056bb16256e7f8057c0
| * Compositor: Add missing cursorSurfaceChanged signalJohan Klokkhammer Helsing2017-10-021-0/+4
| | | | | | | | | | Change-Id: I23a67b8189ab84e6a70c9e3de5da15cf2e9a9d77 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>