File: qt6-fix-build-against-Qt-6.9.patch

package info (click to toggle)
libportal 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,504 kB
  • sloc: ansic: 9,998; python: 2,329; cpp: 898; javascript: 699; sh: 176; makefile: 68; xml: 20
file content (42 lines) | stat: -rw-r--r-- 1,508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Jan Grulich <jgrulich@redhat.com>
Date: Thu, 27 Mar 2025 09:38:10 +0100
Subject: qt6: fix build against Qt 6.9+

QGenericUnixServices was renamed to QDesktopUnixServices in Qt 6.9.

Upstream change: https://codereview.qt-project.org/c/qt/qtbase/+/609639

Origin: upstream, 0.9.2, commit:https://github.com/flatpak/libportal/commit/796053d2eebe4532aad6bd3fd80cdf3b197806ec
---
 libportal/portal-qt6.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libportal/portal-qt6.cpp b/libportal/portal-qt6.cpp
index d38a4e3..34f0d72 100644
--- a/libportal/portal-qt6.cpp
+++ b/libportal/portal-qt6.cpp
@@ -31,8 +31,12 @@
 #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
 #include <qpa/qplatformintegration.h>
 #include <private/qguiapplication_p.h>
+#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
+#include <private/qdesktopunixservices_p.h>
+#else
 #include <private/qgenericunixservices_p.h>
 #endif
+#endif
 
 static gboolean
 _xdp_parent_export_qt (XdpParent *parent,
@@ -45,7 +49,11 @@ _xdp_parent_export_qt (XdpParent *parent,
   }
 
 #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
+  if (const auto services = dynamic_cast<QDesktopUnixServices*>(QGuiApplicationPrivate::platformIntegration()->services()))
+#else
   if (const auto services = dynamic_cast<QGenericUnixServices*>(QGuiApplicationPrivate::platformIntegration()->services()))
+#endif
     {
       g_autofree char *handle = g_strdup(services->portalWindowIdentifier(w).toUtf8().constData());