summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* bradient: Use QWaylandWindow actual window titleKai Uwe Broulik2024-01-103-17/+26
| | | | | | | | | | | | | It may include a suffix containing the application name and is also what's set on the XDG Toplevel, i.e. what the rest of the environment (task switcher, etc) sees. This stores the title in QWaylandWindow and adds a getter to retrieve it. Pick-to: 6.7 Change-Id: I84f41c68b16b680cdbb5cf656c7078d1e41767d4 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandEglWindow: Pass window surface format to q_glFormatFromConfigKai Uwe Broulik2024-01-091-1/+1
| | | | | | | | | Otherwise it disregards the window's swap interval preference. Fixes: QTBUG-120477 Pick-to: 6.7 6.6 6.5 Change-Id: Icc6b192f9f317a80acdf4b588ee3f1c26f2ddf0a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* bradient: Explicitly set Qt::PlainText textFormatKai Uwe Broulik2024-01-091-0/+1
| | | | | | | | | Otherwise a window title containing HTML tags can mess up the layout. Pick-to: 6.7 6.6 6.5 Change-Id: I7bd4abd2e0caa92cbb08c0eb46acba737126c913 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Doc: Add documentation for QML WaylandQuickItem::output propertyAndreas Eliasson2024-01-081-0/+5
| | | | | | | Fixes: QTBUG-120397 Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I52dee0bf480dee26ca71f7a914150be9679f87f3 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QWaylandScreen: Implement subpixelAntialiasingTypeHintKai Uwe Broulik2024-01-062-2/+30
| | | | | | | | | It isn't really used anywhere yet, since on Unix QFontconfigDatabase doesn't use the screen's information. Pick-to: 6.7 6.6 6.5 Change-Id: Icab81b2bf8df1a23223a74f2d4aee94601e0bea3 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* bradient: Don't cache decoration colorsKai Uwe Broulik2024-01-061-12/+9
| | | | | | | | | | Reading them from QPalette on the fly is pretty negligible. Easily ensures that the palette renders with correct colors when the color scheme changes. Pick-to: 6.7 6.6 6.5 Change-Id: I469fa2f32889a7841a3d4c4c8d11e1abf50ae66f Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandShmBackingStore: Preserve buffer contents between framesKai Uwe Broulik2024-01-062-3/+49
| | | | | | | | | | | 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>
* QWaylandWindow: Reset input region on window resetKai Uwe Broulik2024-01-061-0/+3
| | | | | | | | | Amends 604db6b5 and fixes the input region (and thus Qt::WindowTransparentForInput) not working on subsequent shows. Pick-to: 6.7 6.6 Change-Id: Ie160aa0b2c13e6858b31ad98866a8689dfbad149 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Fix window margin calculationRob Hall2024-01-061-2/+2
| | | | | | | | | | | | Don't subtract the size of the window frame margin from the content area. Fixes an issue where an area of the window is unclickable when client-side decorations are in use. Fixes: QTBUG-120392 Pick-to: 6.7 6.6 6.5 Change-Id: I6a89b2d463be084233ea3448cacfbbd09d66b96e Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
* bradient: Use "Size" instead of "Split" cursors for resizingKai Uwe Broulik2024-01-061-3/+3
| | | | | | | | | | | | SizeVerCursor: "A cursor used for elements that are used to vertically resize top-level windows." SizeHorCursor: "A cursor used for elements that are used to horizontally resize top-level windows." Pick-to: 6.7 6.6 6.5 Change-Id: Ib780269120aa373cd9fcf84826683cccd1dc4f4d Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Remove unused Q_Q macros which caused fatal warningsShawn Rutledge2023-12-291-8/+0
| | | | | | | | | | error: unused variable ‘q’ [-Werror=unused-variable] Amends 59ae054ded4d74db53281d8087576cd05b979cd9 Pick-to: 6.7 Change-Id: I8d506ba04723fa9327bbc80e2597d2176e500c2d Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Do not constrain clients to size hintsDavid Edmundson2023-12-281-11/+1
| | | | | | | | | | | | | | | | | The behavior of constraining requests from the system to the client requested size does not appear to be in other backends. It was added to QWayland before xdg-shell/qt-shell existed with hints that can be supplied to the window manager. This is important as the specification states that maximized windows must follow the geometry requested and there is some movement towards this applying for all tiled states. Task-number: QTBUG-120035 Pick-to: 6.7 Change-Id: I7c203db18e34a8f81a39c504591f6b54df076da8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* client: Clean up text input proxy object in textinputv3David Edmundson2023-12-211-0/+1
| | | | | | | | | | | This not only cleans up a tiny amount of memory, but also fixes a potential crash if a wayland event were to arrive on the object after the Qt level wrapper is destroyed. Pick-to: 6.7 Change-Id: Id1c768b1f846925579220784e4312cede4efd095 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: David Redondo <qt@david-redondo.de>
* client: Clean up text input proxy object in textinputv2David Edmundson2023-12-211-0/+1
| | | | | | | | | | This not only cleans up a tiny amount of memory, but also fixes a potential crash if a wayland event were to arrive on the object after the Qt level wrapper is destroyed. Pick-to: 6.5 6.6 6.7 Change-Id: I6fafdd848d61da893304c4467a57b52d3771c508 Reviewed-by: Liang Qi <liang.qi@qt.io>
* QWaylandMimeData: Skip "DELETE" formatKai Uwe Broulik2023-12-201-2/+5
| | | | | | | | | | | | | | | This is presumably a left-over from XDND: https://freedesktop.org/wiki/Specifications/XDND/ > In general, XdndActionMove is implemented by first requesting the data > and then the special target DELETE defined in the X Selection > protocol. [...] DELETE should be sent before XdndFinished. Firefox sends this during dragging of files but trying to fetch it will fail, leading to a timeout and potential freeze. Pick-to: 6.7 6.6 6.5 Change-Id: Ic30f5cb23587c63d54859c5eaebb3a054a25ac69 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Don't use Qt keywords in headersKai Uwe Broulik2023-12-1814-24/+24
| | | | | | | | | | | | | Unfortunately for many Wayland features applications need to access Qt private headers which will fail if the project is built with QT_NO_KEYWORDS. Ideally, the examples and tests were ported, too, and QT_NO_KEYWORDS enabled in .cmakec.conf. Pick-to: 6.7 Change-Id: I9f988d304bcc8dba4dd84761c41ba3da2473515d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove inactionable warnings suggesting qt-text-input-method-unstable-v1Nicolas Fella2023-12-181-4/+0
| | | | | | | | | | | | | | These warnings can appear several times during the program execution, spamming the log. They are also inactionable for desktop use cases, since qt-text-input-method-unstable-v1 is not a protocol implemented by any desktop compositor. Fixes: QTBUG-120171 Pick-to: 6.7 Change-Id: Icd5316000b43e4b16e1eaff9efcc0c363458b9af Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWaylandCursor: Set appropriate shape for drag cursorsKai Uwe Broulik2023-12-141-3/+3
| | | | | | | | | | | Even if the compositor is free to do whatever during a drag, the client can still set a proper cursor. The codepath without cursor-shape also doesn't special case them. Pick-to: 6.7 6.6 Change-Id: Ib6b9864d8024ff2919471d6f2d12f9ba8e2e512d Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* Don't lock render thread when blocking swap is usedEskil Abrahamsen Blomfeldt2023-12-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, Qt will use a non-blocking eglSwapBuffers() and implement our own frame event mechanism with a time-out. When the blocking version of eglSwapBuffers() is in use (either because it's manually enabled or because the driver does not support the alternative), it depends on the main thread to poll events, as it will wait indefinitely for a frame callback. This is incompatible with our locking of the surface for the duration of the frame, since we may end up locking the main thread in QWaylandWindow::reset() during shutdown while the render thread is simultaneously locked in eglSwapBuffers(). The lock was implemented to work around a bug in one family of graphics drivers, so we simply disable it when blocking eglSwapBuffers() is used. If we need to put this back, we would need a more advanced approach and make sure we continue to poll events even while we're waiting for access to the surface. Pick-to: 6.5 6.6 6.7 Fixes: QTBUG-118890 Change-Id: I04f7d2b168726d82c38fe3fafd350dcab928b956 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Support TextInput V3 over v4-wipDavid Edmundson2023-12-1327-425/+325
| | | | | | | | | | | | | | | | | Support for v4-wip was not added into any desktop linux compositors, nor was it ever enabled into the default Qt client builds for clients or compositor. TextInputV3 has become the most widely deployed. Whilst changes are needed, they do not need to be breaking changes. A second iteration of V3 can add the features we need. This is now in motion upstream. For cases where QtWaylandCompositor is used, the custom Qt text input method is preferred to work with the Qt virtual keyboard. Pick-to: 6.7 Change-Id: I01e2686c67846804c0069f1495952b530547f91c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: If the window minimized state is requested do not forward other statesDavid Edmundson2023-12-111-5/+10
| | | | | | | | | | | | In QWindowPrivate::effectiveState if the minimize flag is requested all other states are cleared. This makes sense for the internal representation, but we do not want to send the unset maximised state across the wire. Fixes: QTBUG-119136 Pick-to: 6.7 6.6 Change-Id: I9b758c67ce11420b421a295fe3e65b68bf546027 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Handle subsurfaces with async configureDavid Edmundson2023-12-112-2/+2
| | | | | | | | | | | | | | | With XDG Shell we cannot map a buffer until we get a configure event. To handle this the normal expose events is blocked then sent explicitly when we get this request. This works, but we also need to notify that subsurfaces are now exposed with the parent. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-119882 Fixes: QTBUG-119883 Change-Id: I0ae69c8da702037e7575cfc0939d3e783b50f323 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Error out early when base was build without our native interfacesDavid Redondo2023-12-091-0/+6
| | | | | | | | Instead of letting people run into compile errors, bail out and explain what's wrong. Change-Id: I2f2067ee07d95238e287e39ce78e73eddbca836c Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Adapt to QWaylandScreen being publicDavid Redondo2023-12-091-2/+2
| | | | | Change-Id: I8c260ab7177011fd22db856615c8f72d6a8fabeb Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: implement QWaylandCursor::size()Liang Qi2023-12-082-0/+12
| | | | | | | | | See also 78272c667f008f6afcf5f84e0add525b56c3a558 in qtbase. Fixes: QTBUG-118612 Pick-to: 6.6 6.5 Change-Id: I1cfd0c287b133c21a0ccdc5f283d9997f06fb2ed Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandMimeData: Check text/x-moz-urls for UTF-16Kai Uwe Broulik2023-12-041-10/+23
| | | | | | | | | | | | And fall back to UTF-8 if it's not. When dragging a picture out of Chrome, it sends a simple URL as UTF-8 under text/x-moz-urls. QXcbMime has this fall-back, too but I originally didn't consider it necessary. Pick-to: 6.6 6.5 Change-Id: I52378cfc354de342623e5dd3f7e1d028951e8dab Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Fix enter event cursor position with xdg-popup and QHighDpiScalingIlya Fedin2023-12-041-4/+9
| | | | | | | | | | | QWindowSystemInterface::handleEnterEvent accepts device-dependent position while QCursor::pos provides device-independent position. Use QWaylandCursor::pos instead. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I70d2997610f7a34c6763bd4f10f20a65c3debdbe Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Remove redundant static uint32_t QWaylandDisplay::currentTimeMillisec()Edward Welbourne2023-11-272-12/+0
| | | | | | | | | | Fortunately it was unused. Its 32-bit unsigned return type, measuring time in milliseconds, wraps around every 50 days. If Qt Wayland ever does need to know the current time in milliseconds, I can recommend QDateTime::currentMSecsSinceEpoch(). Change-Id: I03e70e3c7060b1e8fb82fc2e151bb187b6598b96 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Use correct offset handling features for wl_surface version 5David Edmundson2023-11-261-2/+6
| | | | | | | | | In version 5 wl_surface_offset was introduced and requires that is used instead of passing the additional arguments to wl_surface_attach Fixes: QTBUG-119177 Change-Id: I04d7a6f89d17991a8fc536f5cca9d5d8d5418940 Reviewed-by: Inho Lee <inho.lee@qt.io>
* Follow up handleWindowActivated -> handleFocusWindowChanged renameTor Arne Vestbø2023-11-242-2/+2
| | | | | | Change-Id: I75eeae6dfa4af8a17dffaef74f15fc87a58bcf61 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* Warn if eglSwapBuffers failDavid Redondo2023-11-241-1/+2
| | | | | | | | | This failing was the cause of windows freezing on NVidia. If it happens for some other reason we can now see why. Pick-to: 6.6 Change-Id: Iabd44b1b3f73a54adac3024436ffe116ca15d21a Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Switch QWaylandXdgSurface::setSizeHints to the window content geometryIlya Fedin2023-11-231-4/+7
| | | | | | | | | | | | According to the protocol documentation, set_{min,max}_size work in window content geometry while it currently works in QWindow geometry. Practically this excludes shadows and includes the non-shadow part of client-side decoration. Pick-to: 6.6 6.5 Change-Id: Ib702e4c9036a07645ba254ac3cc0e5704a949fe4 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Move topmost grabbing popup tracking to QWaylandWindowVlad Zahorodnii2023-11-174-22/+23
| | | | | | | | | | | | | | | | If the effective transient parent is different from QWaylandWindow::transientParent(), then the popups may be closed in wrong order and producing an xdg-shell protocol error. This change lifts topmost popup tracking from the xdg-shell plugin to QWaylandWindow so it can guess the correct transient parent and the xdg-shell plugin doesn't have to pick a different parent behind our back. Fixes: QTBUG-119110 Pick-to: 6.6 Change-Id: I7c5f780b7bd4c3362aa7b22762ff336ae908ff70 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Always clear queued buffer busy flag when resetting the windowWeng Xuetian2023-11-131-0/+3
| | | | | | | | | | | | | | In 39a003942ebab39a1d3b8bc64f41d0c68e92f4bf, the queued buffer is always set busy, but it may not be reset correctly if the queued buffer is not ever attached due to hiding the surface when window visibility is being updated at a very fast speed. Fixes: QTBUG-118650 Task-number: QTBUG-118650 Pick-to: 6.6 Change-Id: Id0bdd3caa69c821bb84927f01b4839f46eee8a10 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: David Redondo <qt@david-redondo.de>
* Add list is empty judgment,optimize to use constantFeifei Zhan2023-11-031-1/+6
| | | | | | | | the last() method of the mPendingTouchPoints list is judged to be empty before it is called, and the last() is optimised to constLast() according to the logic below. Change-Id: I8ec082a22c223d06dbe848bc70622710b6acfa50 Reviewed-by: Feifei Zhan <noone@onqt.com> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandSurface: client support wl_surface version 6JiDe Zhang2023-11-029-50/+131
| | | | | | | | | | | | | | Add QWaylandWindow::updateScale() function to update the window's scale from QWaylandFractionalScale or QWaylandSurface::preferredBufferScale or QWaylandScreen::scale or QWaylandSurface::preferredBufferScale. Add QWaylandWindow::updateBufferTransform() function to update the window's buffer transform from QScreen::primaryOrientation or QWaylandSurface::preferredBufferTransform. Change-Id: I2742701e92c7403a89df97b7fa06b5b0de6917a7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandMimeData: adapt to qt_safe_poll changes from qtbaseAhmad Samir2023-10-281-5/+3
| | | | | | | It's private API in qtbase and has been changed recently. Change-Id: I763918a035bce67c06a6120e9d7dfb542ca023b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add license headers to shader filesEskil Abrahamsen Blomfeldt2023-10-267-0/+21
| | | | | | | | These need the same licenses as the code. Pick-to: 5.15 6.2 6.5 6.6 Change-Id: Iad59ee3e3cb5f68de92cf6b3b5d8bd4840d4a2ad Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Issue keyReleaseEvent regardless of focusInho Lee2023-10-241-1/+1
| | | | | | | | | | In some cases like using Key.forwardTo, keyReleaseEvent is ignored. It should be generated regardless of focus. Fixes: QTBUG-118042 Pick-to: 6.6 6.5 Change-Id: I154a27542c73264c3238d645e9b18e869c60b19e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Always populate mimedata in dragsDavid Edmundson2023-10-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | It's possible for clients to perform a drag and drop operation within their own client without any mimeData. A user can directly access the original drag. On wayland without any mimedata it's impossible for a client to accept a drag as the mechansim involved is to either select a given mimedata entry or an empty string. Within Qt we always accept the first format if we accept a drag. When dragging within our own window we also start a wayland drag so will receive a cancel event from the compositor if the compositor doesn't believe the client has accepted the drag. This patch provides a dummy mimedata entry so that something can be accepted. Fixes: QTBUG-112161 Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I6309d82e20545e10ebdb9dafde7e13a5e3be5ff2 Reviewed-by: Liang Qi <liang.qi@qt.io>
* client: Provide seatname for multi-seatLu YaNing2023-10-182-0/+8
| | | | | | | | In a multi-seat configuration the seat name can be used by clients to help identify which physical devices the seat represents. Change-Id: Id704ad289fe861c2170380f1575d298e8db03964 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Include what you need: <QPointer>Marc Mutz2023-10-1313-0/+23
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I8eb00fbd2df16300b0cbfc4157612a45c72ac12c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix regression in orphaned texture clean-upThomas Senyk2023-10-102-6/+6
| | | | | | | | | | | | | | | | | | The recently refactored QWaylandTextureOrphanage used sender() in a DirectionConnection, which doesn't work if sender and receiver live in different threads - which happens if multiple windows (and therefor multiple QSGRenderThread) exist This patch fixed that by replacing sender() with a lambda capture Also: fix a weirdly phrased comment Fixes: QTBUG-117932 Pick-to: 6.6 Change-Id: I870e92b448dfd1f9864ff94743cf7accc50fc6ff Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QWaylandWindow: add QWaylandWindow::setScaleJiDe Zhang2023-10-072-23/+24
| | | | | | | | The logic for update window's scale is scattered in multiple places, we should unify their behavior. Change-Id: Ic8ba20fdbc44942aed9b4bd0b0b12dad7bee1719 Reviewed-by: Liang Qi <liang.qi@qt.io>
* client: Implement QWheelEvent::invertedDavid Edmundson2023-09-293-10/+37
| | | | | | | | | | | | | | | "Natural scrolling" is a setting that makes trackpads act in the inverse; moving up moves content down to mimic behavior of touchscreens. However not all scroll events are used for scrolling, so it can be useful to know the real direction. This was exposed in QWheelEvent it just needs plumbing. Change-Id: I050b8b3e55796beff33badb7c073c0b93589294e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* Doc: Highlight 2 examplesKai Köhne2023-09-291-0/+4
| | | | | | | Pick-to: 6.5 6.6 6.6.0 Task-number: QTBUG-117210 Change-Id: I808ae74c3b3c1ab8e4912344d804f1d3741b8dc6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: support Xdg Shell not_shown stateDavid Edmundson2023-09-255-61/+166
| | | | | | | | | | | | | This state is to indicate that a toplevel is not visible, either minimised on another desktop. This maps to QWindow::isExposed. In addition to XdgShell changes. QWaylandWindow is adjusted to check exposure state before sendingExposureEvents. Subsurfaces are un-exposed and re-exposed when the toplevel changes. Change-Id: I76932c2c58681f832c1c2efde3cfde1c32cd3e05 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix use-after-free with animated cursorsPaul Olav Tvete2023-09-191-8/+1
| | | | | | | | | | | | | In WlCallback::callback_done(), m_fn() can cause the callback object to be deleted, so it should not be referenced after that. Since m_autoDelete is never set to true, the rest of callback_done() is dead code and can be removed. Fixes: QTBUG-117067 Pick-to: 6.6 6.5 Change-Id: I0b1a1fcb8204cba789272f3861be4c2e2d0789b4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* Reimplement orphaned texture handlingThomas Senyk2023-09-188-225/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation was a bit error prone (there was a reproducable "dead pointer" issue) and had duplicated code (dma, egl and eglstream share the same code). The new implementation fixes both issues (and more): - no more 'this' capture on a lambda where the 'this' isn't an object and hence can go out of scope without the lambda knowing. - no more duplicated code as we now have a singleton as our orphanage: QWaylandTextureOrphanage 3 (dma, egl, eglstream) HW-integrations use this singleton - the class itself as well as it's container are thread-safe by the usage of QMutex/QMutexLocker. This also includes the deletion code within the orphanage. As the orphanes are 100% owned by the orphanage, they are protected from double deletion. - The cleanup due to QOpenGLContext::aboutToBeDestroyed is now ctx specific, no more lamdba-per-texture. Change-Id: I36e82fae796864319bed7ebdb5154e93dbe96394 Pick-to: 6.6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Fix QT_WAYLAND_RESIZE_AFTER_SWAPVlad Zahorodnii2023-09-121-2/+1
| | | | | | | | | | | | | | | | | | | | mResizeLock can be locked several times by the same thread in the following scenario QWaylandWindow::setGeometry() at qwaylandwindow.cpp:429:43 QWaylandEglWindow::setGeometry() at qwaylandeglwindow.cpp:58:32 QWaylandWindow::resizeFromApplyConfigure() at qwaylandwindow.cpp:517:16 QWaylandXdgSurface::Toplevel::applyConfigure() at qwaylandxdgshell.cpp:91:57 QWaylandXdgSurface::applyConfigure() at qwaylandxdgshell.cpp:381:35 QWaylandWindow::doApplyConfigure() at qwaylandwindow.cpp:628:38 QWaylandWindow::applyConfigure() at qwaylandwindow.cpp:671:25 Since mResizeLock is not a recursive mutex, the main thread just blocks in QWaylandWindow::setGeometry(). To prevent that, this patch changes the type of mResizeLock from QMutex to QRecursiveMutex. Change-Id: I362f4909bfdfc2d91b7cf902f27d35c742ac5091 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>