-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeepin-kwin-fix-qt6.9.2.patch
More file actions
128 lines (114 loc) · 3.36 KB
/
Copy pathdeepin-kwin-fix-qt6.9.2.patch
File metadata and controls
128 lines (114 loc) · 3.36 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
diff -upNr BUILD/src/plugins/qpa/integration.cpp BUILDnew/src/plugins/qpa/integration.cpp
--- BUILD/src/plugins/qpa/integration.cpp 2025-07-15 02:44:48.000000000 +0000
+++ BUILDnew/src/plugins/qpa/integration.cpp 2025-09-13 16:57:58.405219802 +0000
@@ -28,6 +28,8 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
+#include <QDesktopServices> // 确保已包含QDesktopServices头文件
+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtEventDispatcherSupport/private/qunixeventdispatcher_qpa_p.h>
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
@@ -44,23 +46,41 @@ namespace KWin
namespace QPA
{
+
class DDEWaylandTheme: public QGenericUnixTheme {
public:
- QVariant themeHint(ThemeHint hint) const {
+ QVariant themeHint(ThemeHint hint) const override { // 添加override
if (hint == QPlatformTheme::SystemIconThemeName) {
return "bloom";
}
-
return QGenericUnixTheme::themeHint(hint);
}
};
+// 实现自定义服务
+// 添加DDEServices方法实现(仅在Qt6中编译)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool DDEServices::openUrl(const QUrl &url)
+{
+ return QDesktopServices::openUrl(url);
+}
+
+bool DDEServices::openDocument(const QUrl &url)
+{
+ return QDesktopServices::openUrl(url);
+}
+#endif
+
Integration::Integration()
: QObject()
, QPlatformIntegration()
, m_fontDb(new QGenericUnixFontDatabase())
, m_nativeInterface(new QPlatformNativeInterface())
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, m_services(new QGenericUnixServices())
+#else
+ , m_services(new DDEServices())
+#endif
{
}
@@ -246,8 +266,12 @@ QPlatformNativeInterface *Integration::n
QPlatformServices *Integration::services() const
{
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
return m_services.get();
+#else
+ return m_services.get();
+#endif
}
}
-}
+}
\ 文件末尾没有换行符
diff -upNr BUILD/src/plugins/qpa/integration.h BUILDnew/src/plugins/qpa/integration.h
--- BUILD/src/plugins/qpa/integration.h 2025-07-15 02:44:48.000000000 +0000
+++ BUILDnew/src/plugins/qpa/integration.h 2025-09-13 16:59:25.169227876 +0000
@@ -12,15 +12,19 @@
#include <epoxy/egl.h>
#include <QObject>
+// 移除废弃的头文件包含
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtServiceSupport/private/qgenericunixservices_p.h>
-#else
-#include <QtGui/private/qgenericunixservices_p.h>
#endif
#include <qpa/qplatformintegration.h>
#include <memory>
+// 修改为正确的QPlatformServices头文件包含
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#include <qpa/qplatformservices.h>
+#endif
+
namespace KWin
{
@@ -31,6 +35,16 @@ namespace QPA
class Screen;
+// 自定义QPlatformServices实现
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+class DDEServices : public QPlatformServices
+{
+public:
+ bool openUrl(const QUrl &url) override;
+ bool openDocument(const QUrl &url) override;
+};
+#endif
+
class Integration : public QObject, public QPlatformIntegration
{
Q_OBJECT
@@ -63,8 +77,12 @@ private:
std::unique_ptr<QPlatformNativeInterface> m_nativeInterface;
QPlatformScreen *m_dummyScreen = nullptr;
QHash<Output *, Screen *> m_screens;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
std::unique_ptr<QGenericUnixServices> m_services;
+#else
+ std::unique_ptr<DDEServices> m_services;
+#endif
};
}
-}
+}