summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandshmbackingstore.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QWaylandShmBackingStore: Don't clear new buffers in beginPaintKai Uwe Broulik2024-03-051-8/+18
| | | | | | | | | 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-11/+6
| | | | | | | | | | | 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>
* client: Fix deletion of new queued shm buffers during reconnectDavid Redondo2024-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When reconnecting the cleanup of existing buffers is delayed in order to preserve contents and copy them to buffers belonging to the new connection. Due to the order of events it could happen that a new buffer was deleted along with the old ones but still being referenced by a window. During reconnect all QScreens are removed and new ones added for the wl_outputs on the new connection during the initial roundtrips. When the first new QScreen is added all QWindows move form the placeholder screen to it. This can cause for example QWidgets to repaint. At this point the windows are not reinited yet, and the buffer is queued inside the window. Only afterwards the reconnected signal was emitted which would cause deletion of all existing buffers including the newly queued ones. To fix this the signal is moved after the first roundtrip where all globals are announced and new buffers can be created but no new screens have been announced yet. The signal is renamed to be more fit for its new location. Pick-to: 6.7 Pick-to: 6.6 Change-Id: I06be14d235ac342a4b420176aadad3ccf18178fe Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Avoid creating decorations in the render threadDavid Edmundson2024-01-111-1/+0
| | | | | | | | | | | | | | | | | createDecoration is called when on the main thread from when window flags change, implicitly from initWindow, and also every handleWindowStatesChanged which will be called when we get the first configure event in an xdg shell. There is no need to create the decoration in QWaylandGLContext::makeCurrent. Any current call to makeCurrent before the platform window is shown will not create a decoration as there's a check for a shell surface. Any call afterwards will have already been handled by initWindow. Similarly the SHM backend store does not need to handle decorations itself. Fixes: QTBUG-105703 Pick-to: 6.7 Pick-to: 6.6 Change-Id: I644cece28277131cf7a65eaa234ff08c8431d544 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QWaylandShmBackingStore: Preserve buffer contents between framesKai Uwe Broulik2024-01-061-3/+45
| | | | | | | | | | | 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>
* Client: Avoid locking resizing in QWaylandShmBackingStoreVlad Zahorodnii2023-09-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWaylandWindow::setCanResize(false) will block applying configure events. QWaylandWindow::setCanResize(true) will unblock configure events and potentially apply a scheduled configure event if there's one. QWaylandWindow::setCanResize(true) has to be called **after** committing the surface to ensure that the xdg window geometry matches the buffer. We don't want the xdg window geometry change when painting. Unfortunately, setCanResize(true) can be called before the surface is committed when using a RasterSurface, for example - QWaylandShmBackingStore::beginPaint(): calls setCanResize(false) - QWaylandShmBackingStore::endPaint(): calls setCanResize(true) - QWaylandWindow::setCanResize(true): applies pending configure event - QWaylandShmBackingStore::flush(): commits the surface, but the xdg window geometry is wrong now As is, beginPaint() and endPaint() are not entirely correct functions where configure events can be blocked. We need functions that wrap both painting and flushing, which are not feasible with the current backing store design. On the other hand, it's worth noting that blocking configure events in the backing store is not necessary because painting happens on the main thread unlike OpenGL or Vulkan code paths. Given the lack of synchronization points and the fact that rendering happens on the main thread, this change removes blocking configure events in QWaylandShmBackingStore. It fixes dolphin and various other applications that use QtWidgets jumping while being interactively resized. Change-Id: I156e4fd5e04a6bba7e8d48171510d5ab0ec89713 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Don't floor device scale in `QWaylandShmBuffer::imageInsideMargins`Phan Quang Minh2023-05-291-1/+1
| | | | | | | | | | | | | | | | | The offset of the drawing target returned from QWaylandShmBackingStore::contentSurface() is incorrectly calculated due to `mImage.devicePixelRatio()` being casted to `int` inside `imageInsideMargins`, which causes the scale to be rounded down in case of fractional scaled displays. This causes the window contents to be incorrectly positioned on CSD-requiring compositors (e.g. GNOME), eventually resulting in graphics corruption due to mismatched damage and opaque regions. Fix this by removing the incorrect `int` cast. Pick-to: 6.5 Change-Id: I436d24522d23888b641cb21403f773e8ea113b8d Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-071-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an optional mechanism for clients to survive a crash and reconnect seemingly seamlessly. In the event of a disconnect from the compositor socket we simply try to reconnect again and replay any data needed so that we maintain a consistent state to where we left off. From an application point-of-view any open popups will be dismissed and we we potentially get a new framecallback, but it will be almost entirely transparent. Users of custom QWaylandClientExtensions will be notified via the activeChanged signal and rebuild as though the compositor had withdrawn and re-announced the global. OpenGL contexts will be marked as invalid, and handled the same way as a GPU reset. On the next frame RHI will notice these are invalid and recreate them, only now against a new wl_display and new EGLDisplay. Users of low level EGL/native objects might be affected, but the alternative at this point is being closed anyway. The entire codepath is only activated via an environment variable. Change-Id: I6c4acc885540e14cead7640794df86dd974fef4f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix build on CentOS 7Ilya Fedin2023-02-241-0/+10
| | | | | | | | | | | | | | | | | | Have the following errors while attempting to build qtwayland v6.5.0-beta3: /usr/src/Libraries/qt_6.5.0/qtwayland/src/client/qwaylandshmbackingstore.cpp:48:19: error: 'F_ADD_SEALS' was not declared in this scope 48 | fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); | ^~~~~~~~~~~ /usr/src/Libraries/qt_6.5.0/qtwayland/src/client/qwaylandshmbackingstore.cpp:48:32: error: 'F_SEAL_SHRINK' was not declared in this scope 48 | fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); | ^~~~~~~~~~~~~ /usr/src/Libraries/qt_6.5.0/qtwayland/src/client/qwaylandshmbackingstore.cpp:48:48: error: 'F_SEAL_SEAL' was not declared in this scope 48 | fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); | ^~~~~~~~~~~ Pick-to: 6.5 Change-Id: I4b9b3a13ac47483594f454ba36dc5d720cb592a5 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Add F_SEAL_SHRINK seal to shm backing fileVlad Zahorodnii2022-11-181-1/+7
| | | | | | | | | | This lets libwayland-server avoid installing a SIGBUS handler when it wants to mmap() the backing file and access the contents of shared memory client buffers. Change-Id: Id0b17f729799535d73e8700c5a99c32fd88a068a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> 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>
* Replace scale with devicePixelRatio for non-integer scalingJungi Byun2021-03-251-3/+3
| | | | | | | | | | | | | | | 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>
* Don't use deprecated QMatrix class anymoreJarek Kobus2020-01-101-1/+2
| | | | | | Task-number: QTBUG-46653 Change-Id: I038a370ca8af642605709fa5ffdb1c619c60433b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Client: Support running with no screensJohan Klokkhammer Helsing2019-11-121-2/+2
| | | | | | | | | | [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-7/+7
| | | | | | | | | | ...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>
* Eradicate Q_FOREACH loops [1/2]: trivial casesMarc Mutz2019-05-211-1/+2
| | | | | | | | | | | | | | | 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>
* Client: Avoid unnecessarily redrawing decorationsJohan Klokkhammer Helsing2019-05-011-5/+8
| | | | | | | | | | Note: QWaylandAbstractDecoration::update() doesn't actually update anything, it just sets a dirty flag, and this is done explicitly in the other cases when the decorations need to be redrawn as well (title and icon changes). Fixes: QTBUG-75377 Change-Id: I2e8bd3abd3664c741e69a3e83ebf409872ddf31a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-301-2/+1
|\ | | | | | | Change-Id: I1d9281750b06f7584e55759994dc6fcbcc5b2455
| * Client: Don't attach buffers to unexposed windowsJohan Klokkhammer Helsing2018-10-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBackingStore::flush is sometimes called with an unxeposed window, in that case, don't attach the buffer to the wl_surface immediately, as that causes protocol errors with xdg_shell. Flushed buffers are instead stored until we get the first configure event. [ChangeLog][QPA plugin][xdg-shell] Fixed a bug where buffers were sometimes attached and committed before the first configure event, causing protocol errors. Fixes: QTBUG-71345 Change-Id: If9409d97bd25f6b13940c56141920a664c349c8e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* | Don't include system versions of wayland protocolJohan Klokkhammer Helsing2018-10-031-2/+1
|/ | | | | | | | | | | | | | | | | | | | | wayland-client.h and wayland-server.h includes protocol generated for the version of wayland.xml corresponding to the libwayland version. This becomes a problem when we want to support a version of wayland.xml that's newer than the system libwayland. The solution is to include wayland-client-core.h and wayland-client-server.h instead. These headers don't include any wayland-scanner generated code, so we can safely compile and link code generated against the version of wayland.xml that we ship. [ChangeLog] Code generated by qtwaylandscanner now includes wayland-client-core.h and wayland-server-core.h instead of wayland-client.h and wayland-server.h. This might break source compatibility for code using custom wayland extensions. Fixes: QTBUG-70553 Change-Id: Ice0cdb60ecc4f936acc0e158b96f7978549f62c1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Don't commit same buffer multiple timesPaul Olav Tvete2018-08-081-5/+12
| | | | | | | | | | | | | | | | 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>
* Proper naming for backingstore logging categoryPaul Olav Tvete2018-07-091-3/+3
| | | | | | | | The logging category is exported, so the name should be specific. Change-Id: Iffdc89875ef9e3091009780edc614fee10c05532 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Suppress warning about MFD_CLOEXEC being redefinedThiago Macieira2018-05-231-1/+3
| | | | | | | | | glibc 2.27 #defined it as just "1U" instead of the kernel "0x0001U". Same value, but because the tokens are different, this triggers a warning. Change-Id: I052407b777ec43f78378fffd153112449de8cf4f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-271-6/+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-8/+8
| | | | | | | | 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>
* Adapt to qtbase 5.10 API change: qssize_t -> qsizetypeLiang Qi2018-01-071-1/+1
| | | | | | | Task-number: QTBUG-65600 Done-with: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I34116dad8eecd01090596270965b9a24f6fe8f39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QImage::sizeInBytes() instead of deprecated QImage::byteCount()Johan Klokkhammer Helsing2017-10-191-4/+4
| | | | | Change-Id: If3f21fc43d0118c1819d354c8ef43f1b79617c7b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-1/+1
| | | | | | | 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>
* QWaylandShmBuffer: use a memfd if we can for a simple memory bufferv5.10.0-alpha1Thiago Macieira2017-08-261-7/+28
| | | | | | | | which has a file descriptor we can also use to share with Change-Id: I8d96dea9955d4c749b99fffd14cd61628c616b30 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWaylandShmBuffer: use QTemporaryFileThiago Macieira2017-07-311-20/+12
| | | | | | | | | | | | | | | Instead of using mkstemp. Even current glibc versions do not open the file with O_CLOEXEC, so this code is not thread-safe. QTemporaryFile is. And since Qt 5.10, it will also use O_TMPFILE on Linux, so the file will not actually exists on disk. Take this opportunity to use the runtime directory instead of /tmp. There's no guarantee that the /tmp filesystem can support mmap'ing, while XDG_RUNTIME_DIR has that guarantee. It's also usually a tmpfs, so no data will be leaked to disk. Change-Id: I8d96dea9955d4c749b99fffd14cd5335d1114cef Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Translucent background supportTasuku Suzuki2017-06-191-1/+9
| | | | | | Change-Id: I6e7b5869097f579020c7a4439441a63a0771e955 Task-number: QTBUG-55956 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Use new feature system, part 2Lars Knoll2016-11-231-2/+2
| | | | | | | | | 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>
* Create and destroy the shell surface when showing and hidingGiulio Camuffo2016-11-171-7/+1
| | | | | | | | | | | | | | | | | | This changes the shell surface handling for windows, and instead of creating the shell surface at initialization time, and then attaching a null buffer to hide it, it creates the shell surface on setVisible(true), and destroys it on setVisible(false). This fixes hiding when using xdg_shell, as that interface defines that attaching a null buffer to an xdg_surface is an error. Also this should help with bugged EGL drivers which attach a buffer after eglSwapBuffers() returns, which used to cause a newly hidden window to get a new valid buffer after we attached a null one, showing it again. Task-number: QTBUG-47902 Change-Id: I8e0a0442319a98cc1361803ea7be1d079b36fc8c Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove useless method QWaylandShmBackingStore::hiddenJohan Klokkhammer Helsing2016-11-111-4/+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-08-011-10/+18
|\ | | | | | | Change-Id: I75a8ddc0652f3c6f438ef98e940c9357450d29c6
| * Fix high-DPI scaling of window decorations for shared memory buffersJohan Klokkhammer Helsing2016-07-111-10/+18
| | | | | | | | | | Change-Id: I6833ab86ffdb4e37dad5108baddb7a54cfb5e9fa Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'qt/5.6' into 5.7Paul Olav Tvete2016-03-081-107/+69
|\| | | | | | | Change-Id: Iada0e076ee33e8d39ecc4f40edfd9764ba610c03
| * Fix SHM drawing logicGiulio Camuffo2016-03-071-86/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Support non-blocking flush for shm subsurfacesMikko Levonmaa2015-11-281-12/+31
| | | | | | | | | | | | Change-Id: I6cc8d5214c905d6b2e9f0c2eebb07d1cb897f74a Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Mikko Levonmaa <mikko.levonmaa@bitfactor.fi>
* | Add QWayland::shm object to clientMikko Levonmaa2015-09-251-3/+3
|/ | | | | | | | | | Allows more flexibility for the client to determine additional shm formats supported by the compositor in addition to the standard types. For example YUV formats. Change-Id: Ib4a47c1d5bbeed9314d5ad5f5f8e1551c1dd71e4 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Mikko Levonmaa <mikko.levonmaa@bitfactor.fi>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-4/+8
|\ | | | | | | | | | | | | | | Conflicts: src/client/qwaylandshmbackingstore.cpp src/client/qwaylandwindow.cpp Change-Id: I795fd08f0fc5d3cb5ed55bf16e724f66b7567723
| * Fix shm buffers init and destruction on failureOlivier Blin2015-03-271-4/+8
| | | | | | | | | | | | | | | | | | | | Some pointers need to be initialized in QWaylandBuffer and QWaylandShmBuffer, and checked at destruction. This avoids crashes when shm surface creation fails. Change-Id: I6f6afa3cc6c67533b5130700cbc27b271764109e 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>
* | Add a SHM format converter classJorgen Lind2015-02-051-1/+5
| | | | | | | | | | | | | | | | | | This class helps keeing one lookuptable for server and client It relies on that wayland-(client|server)-protocol.h being included before the qwaylandshmformathelper.h Change-Id: I12158126a80c8fef5c52427d35792f33716020f1 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.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/+3
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/compositor/compositor_api/qwaylandsurface.cpp Change-Id: I3ee40153c959dbe31ea685571c5a8bb1ae36606e
| * Fix possible double free when hiding a windowGiulio Camuffo2014-12-061-0/+3
| | | | | | | | | | | | | | | | | | 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-6/+12
|/ | | | | | | | | | | | | | | | | | | | | | | 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>