summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandshmbackingstore_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QWaylandShmBackingStore: Don't clear new buffers in beginPaintKai Uwe Broulik2024-03-051-2/+2
| | | | | | | | | QFile::resize done upon creation of the buffer already ensures the buffer is filled with zeroes, so there is no need to paint it transparent if the buffer had just been created. Change-Id: I73ab297f148987acf52a0e08c7dd1ca57f7255be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QWaylandShmBackingStore: Split buffer preparation into dedicated methodKai Uwe Broulik2024-02-151-2/+1
| | | | | | | | | | | Drop "resize(QRect)" since it is ambiguous with the resize coming from QPlatformBackingStore. This allows to ensure a back buffer from multiple places, such as the upcoming "scroll" support. Change-Id: I43a5ece2d0e25e64b41335ba59b2b8c4ffcfff74 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandShmBackingStore: Preserve buffer contents between framesKai Uwe Broulik2024-01-061-0/+4
| | | | | | | | | | | Doing a memcpy is quite expensive, particularly when only a small region of the buffer (such as a blinking cursor) actually changed. Instead, keep track of the damaged region and paint only what actually changed into the buffer to be used. Change-Id: Ibd81bbfe20d0750ddb751f41722a316387225ba6 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Use SPDX license identifiersLucie Gérard2022-06-101-38/+2
| | | | | | | | | | | 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>
* QtWaylandClient: use the CMake exports.h supportThiago Macieira2022-04-281-2/+2
| | | | | | | | | | | | The one in qtwaylandglobal.h was wrong. It just happened to work on Linux because the lack of import wasn't an error... until GCC 12 with -mno-direct-extern-access. Pick-to: 6.3 Change-Id: If05aeeb7176e4f13af9afffd16e8535b469f9158 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Replace scale with devicePixelRatio for non-integer scalingJungi Byun2021-03-251-1/+1
| | | | | | | | | | | | | | | The 'scale' event from wayland cannot support non-integer scaling which was originally supported in Qt. As default, devicePixelRatio follows the 'scale' so that the high DPI still works as the mechanism in Wayland. But if non-integer scaling factor such as 150% is needed, it can be supported to override the devicePixelRatio. Change-Id: I63a04db27bd521264b6d0904e1ddd05a572dc970 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Jungi Byun <jungi.byun@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Support running with no screensJohan Klokkhammer Helsing2019-11-121-1/+1
| | | | | | | | | | [ChangeLog][QPA plugin] The QPA plugin now supports running with no screens attached. This is handled by adding a fake screen when the last screen is disconnected, similarly to what the other QPA plugins do. Fixes: QTBUG-79111 Change-Id: I4a0e023ae784217dd030f0c62f12487fdff4825c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* QWaylandShmBackingStore: replace a QLinkedList with std::listMarc Mutz2019-07-121-2/+3
| | | | | | | | | | ...and mark the module QLinkedList-free. QLinkedList is going to be deprecated. Change-Id: Ieb9efef24cd8677edc1262f22b7c6d41b6376347 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Don't commit same buffer multiple timesPaul Olav Tvete2018-08-081-0/+2
| | | | | | | | | | | | | | | | In Qt we call flush() when we think the window might need to be updated. It is also possible to trigger a flush while painting. Two fixes: 1) If there are attempted flushes between beginPaint() and endPaint, queue them up, and do them in endPaint(). 2) Make sure we only commit the buffer once: after that the compositor owns the buffer, and it can repaint on its own. Change-Id: Ibf61068fa95760eb67dbc0b1d0534854114ea528 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Use override when applicableJohan Klokkhammer Helsing2018-02-281-2/+2
| | | | | | | | | | 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>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-271-6/+6
| | | | | | | | | | | | | | | | | | | | 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>
* Translucent background supportTasuku Suzuki2017-06-191-1/+1
| | | | | | Change-Id: I6e7b5869097f579020c7a4439441a63a0771e955 Task-number: QTBUG-55956 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix warning about inconsistent use of override keywordv5.9.0-beta2Thiago Macieira2017-04-041-1/+1
| | | | | | | | | qwaylandshmbackingstore_p.h:93:19: warning: 'paintDevice' overrides a member function but is not marked 'override' [-Winconsistent-missing- override Change-Id: I27b55fdf514247549455fffd14b1791d4dd6b6b3 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-231-7/+7
| | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use new feature system, part 2Lars Knoll2016-11-231-1/+1
| | | | | | | | | Convert all uses of QT_NO_FOO to proper QT_CONFIG(foo) checks. Change-Id: Id0f0b3325c246567a43d6b2d71b0d69e5535e648 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Remove useless method QWaylandShmBackingStore::hiddenJohan Klokkhammer Helsing2016-11-111-1/+0
| | | | | | Change-Id: I8e28d3c1dc2c2bbff4517ffe3b2f63c2ac86b95f Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-301-5/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandinputcontext_p.h src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h Change-Id: Iac517e1985e4e67d7ca00ca4c10dcda9dd9079f9
| * Add missing Q_DECL_OVERRIDEs to client classes.Johan Klokkhammer Helsing2016-06-271-5/+5
| | | | | | | | | | | | Change-Id: I10e550a25ce498bbeedc242ac73059cc6fdcef30 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'qt/5.6' into 5.7Paul Olav Tvete2016-03-081-7/+3
|\| | | | | | | Change-Id: Iada0e076ee33e8d39ecc4f40edfd9764ba610c03
| * Fix SHM drawing logicGiulio Camuffo2016-03-071-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old logic didn't care to listen for wl_buffer.release events so it always drew in the same buffer, potentially resulting in tearing if the compositor was scanning out the buffer at the same time. Instead properly cycle between a few buffers and don't reuse the same one until the release event was received. The old code also used to throttle the redraws, unless the buffer was changing, that is unless the window was getting resized. This is now lost, and no throttling is ever done. Doing it properly, by waiting for the frame callback before committing the new buffer shows very noticeable lags with many applications when resizing, because they paint many times per resize event, so they fall behind the cursor. A proper fix will be to implement the support for requestUpdate(), and using it in the applications. Change-Id: I02732c34769a5c75a6ad68c095bae916e4b274d3 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Updated license headersAntti Kokko2016-01-201-14/+20
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I76ae5d3e64f096eb3163d6163a38d68c7c1ca756 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-051-0/+11
| | | | | Change-Id: I70c01453b3939d1d645d626ae84c21ab4c9d267a Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Update copyright headersJani Heikkinen2015-02-171-22/+14
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I5a74d32515c3f1fe7aa1916f4241c92832510f8c Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
* Namespace the platform pluginsGiulio Camuffo2015-01-291-0/+4
| | | | | | | | | | | | There currently is a QWaylandInputDevice class both in the wayland QPA plugin and in the QtCompositor API. This causes the qwindow-compositor example to crash when running nested in a wayland session due to a mismatch between the two classes. By namespacing all the plugin code we make sure that name clashes will not happen anymore. Change-Id: I17497cff697599200bea68bf01dfde474526390f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-0/+2
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/compositor/compositor_api/qwaylandsurface.cpp Change-Id: I3ee40153c959dbe31ea685571c5a8bb1ae36606e
| * Fix possible double free when hiding a windowGiulio Camuffo2014-12-061-0/+2
| | | | | | | | | | | | | | | | | | There was a race condition between the gui and the wayland event thread which could lead to double freeing the QWaylandShmBackingStore's frame callback. Protect the wl_callback_destroy calls using a mutex. Change-Id: Ia70ebac208a6d4450328ba5254a850be26d84d6d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Implement high-dpi supportMorten Johan Sorvig2014-12-171-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | Wayland 1.2 added support for display scaling, where wl_output has a "scale" event informing the the client that the compositor will scale the output surfaces by the given factor. The client then has the option of providing large surfaces to match the target pixel densety and bypass the compositor's scaling. This is done by calling wl_surface::set_buffer_scale. Re-use the current high-dpi support in Qt by implementing devicePixelRatio() for QWaylandScreen and QWaylandWindow. Provide high resolution buffers both for raster and OpenGL graphics. Introduce a new coordinate system: buffer coordinates, which is related to the window coordinate system via an "int scale" scale factor. This scale factor corresponds to Qts qreal devicePixelRatio, but we keep the name and the type in the QtWayland implementation. Change-Id: Ie10d7e5b4833480a9a25d96a26ad02150eb6e83f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Fix -no-opengl buildsLaszlo Agocs2014-10-141-0/+2
| | | | | | Task-number: QTBUG-41677 Change-Id: I039ec581e960eb70eb04aed6e65add70c563ba77 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Fix shm windows sometimes not showing after being hiddenGiulio Camuffo2014-10-061-0/+1
| | | | | | | | | | | | | | | QWaylandShmBackingStore installs a frame callback on flush, and subsequent flushes will not attach a new buffer until the callback is fired. If the window is hidden while we're waiting for the callback, we attach a NULL buffer, so the compositor will not redraw the surface and will not fire the frame callback. When showing the window again the backing store's flush() will wait indefinitely for the frame callback to attach its buffer. To fix it destroy the frame callback when the window is hidden. This was easily noticeable when fast switching between popup menus. Change-Id: Ic0c71ed79e2fab9faf452f63b05bc4576ea9a3ba Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Rename QWaylandDecoration => QWaylandAbstractDecorationRobin Burchell2014-09-231-2/+2
| | | | | | | This is in preparation for decoration plugins. Change-Id: Idb322a7a5cbc2eb5bf2cce019073f9f4fb46297f Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Support RasterGLSurface windowsLaszlo Agocs2014-08-251-2/+5
| | | | | | | | | | | | | | | | | In an attempt to make QOpenGLWidget and QQuickWidget working on Wayland. Since Qt 5.3 all widget windows are of type RasterGLSurface (given that the plugin reports this capability which wayland will, with this patch). Such a window can behave either like a raster or an OpenGL window. This concept maps badly to platform plugins that have a rigid separation between raster and OpenGL platform window implementations. From now on, the OpenGL window implementation, that is used pretty much always, except for raw RasterSurface windows, must be prepared to behave like a raster window too, which involves having a backingstore. Change-Id: I0226704b8d5893843fcae68059c5fe9ad2f5e761 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Reduce headers inter-dependency in the QPA pluginGiulio Camuffo2014-06-161-20/+2
| | | | | Change-Id: I8b810e54531453b6a80250555c21bb0b1e6e76cc Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Make classes in client privateJorgen Lind2013-12-271-0/+134
Change-Id: Ibf400b32f78a6a0fcf0991914d2d9ad684483979 Reviewed-by: Andy Nichols <andy.nichols@digia.com>