From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F32F21581C1 for ; Fri, 12 Jul 2024 04:34:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D9B72BC01E; Fri, 12 Jul 2024 04:34:04 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1156E2BC01E for ; Fri, 12 Jul 2024 04:34:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 06044343029 for ; Fri, 12 Jul 2024 04:34:03 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B3EE1BFC for ; Fri, 12 Jul 2024 04:34:01 +0000 (UTC) From: "Ionen Wolkens" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" Message-ID: <1720758603.7bf9c926594fa620acf118a873672d61dd98b252.ionen@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwayland/files/, dev-qt/qtwayland/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-qt/qtwayland/files/qtwayland-6.7.2-drag-drop.patch dev-qt/qtwayland/files/qtwayland-6.7.2-thread-safety.patch dev-qt/qtwayland/qtwayland-6.7.2-r2.ebuild X-VCS-Directories: dev-qt/qtwayland/files/ dev-qt/qtwayland/ X-VCS-Committer: ionen X-VCS-Committer-Name: Ionen Wolkens X-VCS-Revision: 7bf9c926594fa620acf118a873672d61dd98b252 X-VCS-Branch: master Date: Fri, 12 Jul 2024 04:34:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 386491a2-6c67-4ac7-9fcb-f95a15d7afcd X-Archives-Hash: e22398a941145d59b4bd115145e37624 commit: 7bf9c926594fa620acf118a873672d61dd98b252 Author: Ionen Wolkens gentoo org> AuthorDate: Fri Jul 12 04:30:03 2024 +0000 Commit: Ionen Wolkens gentoo org> CommitDate: Fri Jul 12 04:30:03 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bf9c926 dev-qt/qtwayland: backport more fixes to help plasma Signed-off-by: Ionen Wolkens gentoo.org> .../files/qtwayland-6.7.2-drag-drop.patch | 67 ++++++++++++++++++++++ .../files/qtwayland-6.7.2-thread-safety.patch | 65 +++++++++++++++++++++ dev-qt/qtwayland/qtwayland-6.7.2-r2.ebuild | 67 ++++++++++++++++++++++ 3 files changed, 199 insertions(+) diff --git a/dev-qt/qtwayland/files/qtwayland-6.7.2-drag-drop.patch b/dev-qt/qtwayland/files/qtwayland-6.7.2-drag-drop.patch new file mode 100644 index 000000000000..6141d95cb834 --- /dev/null +++ b/dev-qt/qtwayland/files/qtwayland-6.7.2-drag-drop.patch @@ -0,0 +1,67 @@ +Backport from upcoming 6.7.3[1][2] for [3][4]. + +[1] https://github.com/qt/qtwayland/commit/85ec3ae70b905ddf9e16d86c468446d74867743f +[2] https://codereview.qt-project.org/c/qt/qtwayland/+/565408 +[3] https://bugs.kde.org/show_bug.cgi?id=482770 +[4] https://bugs.kde.org/show_bug.cgi?id=490059 + +From: =?UTF-8?q?Niccol=C3=B2=20Venerandi?= +Date: Mon, 3 Jun 2024 12:19:59 +0200 +Subject: [PATCH] Emit a LeaveEvent on drag and drop start + +All focused windows will now receive a LeaveEvent when a drag and drop starts. +This makes sure that the dragged element does not preserve any hover decoration +during the drag and drop, and that other elements that happen to take place +of the dragged elements don't become hovered too. +--- a/src/client/qwaylanddnd.cpp ++++ b/src/client/qwaylanddnd.cpp +@@ -29,4 +29,9 @@ + void QWaylandDrag::startDrag() + { ++ // Some compositors do not send a pointer leave before starting a drag, some do. ++ // This is discussed upstream at: https://gitlab.freedesktop.org/wayland/wayland/-/issues/444 ++ // For consistency between compositors we emit the leave event here, upon drag start. ++ m_display->currentInputDevice()->handleStartDrag(); ++ + QBasicDrag::startDrag(); + QWaylandWindow *icon = static_cast(shapedPixmapWindow()->handle()); +--- a/src/client/qwaylandinputdevice.cpp ++++ b/src/client/qwaylandinputdevice.cpp +@@ -524,4 +524,10 @@ + } + ++void QWaylandInputDevice::handleStartDrag() ++{ ++ if (mPointer) ++ mPointer->leavePointers(); ++} ++ + #if QT_CONFIG(wayland_datadevice) + void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device) +@@ -880,4 +886,12 @@ + window->handleMouse(mParent, e); + } ++} ++ ++void QWaylandInputDevice::Pointer::leavePointers() ++{ ++ if (auto *window = focusWindow()) { ++ LeaveEvent e(focusWindow(), mSurfacePos, mGlobalPos); ++ window->handleMouse(mParent, e); ++ } + } + +--- a/src/client/qwaylandinputdevice_p.h ++++ b/src/client/qwaylandinputdevice_p.h +@@ -93,4 +93,5 @@ + void setCursor(const QCursor *cursor, const QSharedPointer &cachedBuffer = {}, int fallbackOutputScale = 1); + #endif ++ void handleStartDrag(); + void handleEndDrag(); + +@@ -321,4 +322,5 @@ + public: + void releaseButtons(); ++ void leavePointers(); + + QWaylandInputDevice *mParent = nullptr; diff --git a/dev-qt/qtwayland/files/qtwayland-6.7.2-thread-safety.patch b/dev-qt/qtwayland/files/qtwayland-6.7.2-thread-safety.patch new file mode 100644 index 000000000000..92be3b81d5b0 --- /dev/null +++ b/dev-qt/qtwayland/files/qtwayland-6.7.2-thread-safety.patch @@ -0,0 +1,65 @@ +Backport from 6.8 branch which should later land in 6.7.3 in [1] for [2]. + +[1] https://codereview.qt-project.org/c/qt/qtwayland/+/574983 +[2] https://bugs.kde.org/show_bug.cgi?id=489180 + +From: David Edmundson +Date: Fri, 05 Jul 2024 16:13:40 +0100 +Subject: [PATCH] Client: Improve thread safety determining window size on the render thread + +updateSurface is called from both the render and GUI thread. We +therefore need every property referenced to be thread safe. + +Rather than guarding each property we cache the buffer size whenever the +window geometry or scale changes and put a mutex round this one +variable. +--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp ++++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +@@ -51,4 +51,13 @@ + void QWaylandEglWindow::ensureSize() + { ++ // this is always called on the main thread ++ QMargins margins = mWindowDecoration ? frameMargins() : QMargins{}; ++ QRect rect = geometry(); ++ QSize sizeWithMargins = (rect.size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom())) * scale(); ++ { ++ QWriteLocker lock(&m_bufferSizeLock); ++ m_bufferSize = sizeWithMargins; ++ } ++ + updateSurface(false); + } +@@ -61,12 +70,15 @@ + // Just resize the wl_egl_window, the EGLSurface will be created + // the next time makeCurrent is called. +- updateSurface(false); ++ ensureSize(); + } + + void QWaylandEglWindow::updateSurface(bool create) + { +- QMargins margins = mWindowDecoration ? frameMargins() : QMargins{}; +- QRect rect = geometry(); +- QSize sizeWithMargins = (rect.size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom())) * scale(); ++ ++ QSize sizeWithMargins; ++ { ++ QReadLocker lock(&m_bufferSizeLock); ++ sizeWithMargins = m_bufferSize; ++ } + + // wl_egl_windows must have both width and height > 0 +--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h ++++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h +@@ -61,5 +61,11 @@ + + QSurfaceFormat m_format; ++ // Size used in the last call to wl_egl_window_resize + QSize m_requestedSize; ++ ++ // Size of the buffer used by QWaylandWindow ++ // This is always written to from the main thread, potentially read from the rendering thread ++ QReadWriteLock m_bufferSizeLock; ++ QSize m_bufferSize; + }; + diff --git a/dev-qt/qtwayland/qtwayland-6.7.2-r2.ebuild b/dev-qt/qtwayland/qtwayland-6.7.2-r2.ebuild new file mode 100644 index 000000000000..eab3c3a8d3a5 --- /dev/null +++ b/dev-qt/qtwayland/qtwayland-6.7.2-r2.ebuild @@ -0,0 +1,67 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit qt6-build + +DESCRIPTION="Wayland platform plugin for Qt" + +if [[ ${QT6_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi + +IUSE="accessibility compositor qml vulkan" + +RDEPEND=" + dev-libs/wayland + ~dev-qt/qtbase-${PV}:6[accessibility=,gui,opengl,vulkan=,wayland] + media-libs/libglvnd + x11-libs/libxkbcommon + compositor? ( + qml? ( ~dev-qt/qtdeclarative-${PV}:6 ) + ) +" +DEPEND=" + ${RDEPEND} + vulkan? ( dev-util/vulkan-headers ) +" +BDEPEND="dev-util/wayland-scanner" + +PATCHES=( + "${FILESDIR}"/${P}-plasma-popup.patch + "${FILESDIR}"/${P}-drag-drop.patch + "${FILESDIR}"/${P}-thread-safety.patch +) + +CMAKE_SKIP_TESTS=( + # segfaults for not-looked-into reasons, but not considered + # an issue given >=seatv5 exists since wayland-1.10 (2016) + tst_seatv4 + # needs a compositor/opengl, skip the extra trouble + tst_surface + tst_xdgdecorationv1 + # known failing with wayland-1.23.0 (or at least with offscreen), not + # believed to result in critical runtime issues so skip until this is + # looked at upstream (https://bugreports.qt.io/browse/QTBUG-126379) + tst_client + tst_compositor + tst_scaling +) + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package qml Qt6Quick) + $(qt_feature compositor wayland_server) + ) + + qt6-build_src_configure +} + +src_test() { + # users' session setting may break tst_clientextension (bug #927030) + unset DESKTOP_SESSION XDG_CURRENT_DESKTOP + unset GNOME_DESKTOP_SESSION_ID KDE_FULL_SESSION + + qt6-build_src_test +}