gui-apps/xwaylandvideobridge: add 0.4.0_p20250215, fix build w/ Qt 6.10

Update dependencies (upstream commit c2017e5d42bcf6623399b870a269bd4c772cef06)

Bug: https://bugs.gentoo.org/966307
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2025-12-19 16:37:18 +01:00
parent a87de78185
commit bcdf69e865
3 changed files with 129 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST xwaylandvideobridge-0.4.0.tar.xz 35668 BLAKE2B c21857821bfc16b5df14feeea2ea188cedb00f1f3634335a359ba0938b8fb50f5ccf914011f6aca5bd527740ea62297ba9e4171604147d10d87725a0b545d96b SHA512 d0352b7ce94f1a355d8fd8f42a45436483a87d90da1904295f984012859651472eabbca39df5107793790d48474b6de1c8766e31461d1548134547cbc7dfd5a4
DIST xwaylandvideobridge-0.4.0_p20250215-b7d6dd1f.tar.xz 37464 BLAKE2B 45051ac9bf2f029cff3ffc21c64584d2e86474296aecf3bb95beffaf5c772cbb267f2f904625a5dbc37c7f332878da577f49358df8445778b6fe7eb8fdf4405a SHA512 e4c768b61df40fe814240658de27369ab2ef871bf980a53bf3d2c8ce26bd5e3e4f07b5c30b7fd4e80e71dd9f87128d6bdbbf5bcd42fa06c8c7d7b5aee75e90ff

View File

@@ -0,0 +1,92 @@
From 81348eeefeb4b390c530dcc89c8b9f9d1345ffaa Mon Sep 17 00:00:00 2001
From: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Thu, 30 Jan 2025 21:48:57 +0100
Subject: [PATCH] Port from GuiPrivate
Use KWindowSystem::isPlatformX11() from KWindowSystem that we already use
and for Qt 6 port to QNativeInterface.
This avoids depending on GuiPrivate.
While at it, include xcb explicitly and don't rely on the Qt header
(that we no longer include) to include it.
---
src/CMakeLists.txt | 4 +---
src/contentswindow.cpp | 24 +++++++++++++++++-------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b707d36..6781162 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -37,9 +37,7 @@ target_link_libraries(xwaylandvideobridge
XCB::RECORD
)
-if(QT_MAJOR_VERSION STREQUAL "6")
- target_link_libraries(xwaylandvideobridge Qt6::GuiPrivate)
-elseif(QT_MAJOR_VERSION STREQUAL "5")
+if(QT_MAJOR_VERSION STREQUAL "5")
target_link_libraries(xwaylandvideobridge Qt5::X11Extras)
endif()
diff --git a/src/contentswindow.cpp b/src/contentswindow.cpp
index 88b13a3..f7f4f14 100644
--- a/src/contentswindow.cpp
+++ b/src/contentswindow.cpp
@@ -12,12 +12,12 @@
#include <KWindowSystem>
#include <KX11Extras>
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
-#include <private/qtx11extras_p.h>
-#else
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#endif
+#include <xcb/xcb.h>
+
struct MotifHints
{
u_int32_t flags = 0;
@@ -45,6 +45,16 @@ static xcb_atom_t intern_atom(xcb_connection_t *c, const char *name)
return atom;
}
+static xcb_connection_t *xConnection()
+{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ auto x11App = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
+ return x11App->connection();
+#else
+ return QX11Info::connection();
+#endif
+}
+
ContentsWindow::ContentsWindow()
{
resize(QSize(100, 100));
@@ -64,8 +74,8 @@ ContentsWindow::ContentsWindow()
// that keeps us valid for streams
MotifHints hints;
hints.flags = 2;
- xcb_atom_t motif_hints_atom = intern_atom(QX11Info::connection(), "_MOTIF_WM_HINTS");
- xcb_change_property(QX11Info::connection(), XCB_PROP_MODE_REPLACE, winId(), motif_hints_atom, motif_hints_atom, 32, 5, (const void *)&hints);
+ xcb_atom_t motif_hints_atom = intern_atom(xConnection(), "_MOTIF_WM_HINTS");
+ xcb_change_property(xConnection(), XCB_PROP_MODE_REPLACE, winId(), motif_hints_atom, motif_hints_atom, 32, 5, (const void *)&hints);
handleResize();
}
@@ -101,6 +111,6 @@ void ContentsWindow::handleResize()
frame.left = width() -1 ;
setX(-width() + 1); // unforutnately we still need 1px on screen to get callbacks
- xcb_atom_t gtk_frame_extent_atom = intern_atom(QX11Info::connection(), "_GTK_FRAME_EXTENTS");
- xcb_change_property(QX11Info::connection(), XCB_PROP_MODE_REPLACE, winId(), gtk_frame_extent_atom, XCB_ATOM_CARDINAL, 32, 4, (const void *)&frame);
+ xcb_atom_t gtk_frame_extent_atom = intern_atom(xConnection(), "_GTK_FRAME_EXTENTS");
+ xcb_change_property(xConnection(), XCB_PROP_MODE_REPLACE, winId(), gtk_frame_extent_atom, XCB_ATOM_CARDINAL, 32, 4, (const void *)&frame);
}
--
GitLab

View File

@@ -0,0 +1,36 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
COMMIT=b7d6dd1f56380db2d37e4035951653567f10a12d
KFMIN=6.9.0
QTMIN=6.8.1
KDE_ORG_CATEGORY="system"
inherit ecm kde.org xdg
DESCRIPTION="Screenshare Wayland windows to XWayland apps"
HOMEPAGE="https://planet.kde.org/david-edmundson-2023-03-22-fixing-wayland-xwayland-screen-casting/
https://invent.kde.org/system/xwaylandvideobridge"
SRC_URI="https://dev.gentoo.org/~asturm/distfiles/kde/${P}-${COMMIT:0:8}.tar.xz"
S="${WORKDIR}/${PN}"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
DEPEND="
>=dev-qt/qtbase-${QTMIN}:6[dbus,gui,widgets,X]
>=dev-qt/qtdeclarative-${QTMIN}:6
>=kde-frameworks/kcoreaddons-${KFMIN}:6
>=kde-frameworks/ki18n-${KFMIN}:6
>=kde-frameworks/kwindowsystem-${KFMIN}:6[X]
kde-plasma/kpipewire:6
media-libs/freetype
x11-libs/libxcb:=
x11-libs/xcb-util
"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"
PATCHES=( "${FILESDIR}/${P}-qt-6.10.patch" ) # bug #966307