File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,12 +52,32 @@ include(DDEShellPackageMacros)
5252include (KDEClangFormat )
5353include (KDEGitCommitHooks )
5454
55- find_package (Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient DBus LinguistTools Sql )
55+ find_package (Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient WaylandCompositor DBus LinguistTools Sql )
5656find_package (Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui )
5757find_package (ICU 74.2 REQUIRED COMPONENTS uc i18n io )
5858find_package (WaylandProtocols REQUIRED )
5959find_package (PkgConfig REQUIRED )
6060
61+ try_compile (COMPILE_RESULT
62+ ${CMAKE_CURRENT_BINARY_DIR } /try_compile_build
63+ SOURCES ${CMAKE_SOURCE_DIR } /tests/check/qt_wayland_keyextension.cpp
64+ LINK_LIBRARIES
65+ Qt${QT_VERSION_MAJOR}::WaylandCompositorPrivate
66+ Qt${QT_VERSION_MAJOR}::WaylandCompositor
67+ COMPILE_DEFINITIONS
68+ -DQT_WAYLANDCOMPOSITOR_LIB
69+ -DQT_WAYLANDCOMPOSITORPRIVATE_LIB
70+ -DQT_WAYLANDCOMPOSITOR_IMPLEMENTATION
71+ OUTPUT_VARIABLE compile_output
72+ )
73+
74+ if (COMPILE_RESULT)
75+ message (STATUS "Deepin Qt detected (try_compile success)" )
76+ add_definitions (-DUSE_DEEPIN_QT )
77+ else ()
78+ message (STATUS "Deepin Qt not detected" )
79+ endif ()
80+
6181add_subdirectory (frame )
6282add_subdirectory (shell )
6383add_subdirectory (example )
Original file line number Diff line number Diff line change 2222#include < private/qwaylandcompositor_p.h>
2323#undef protected
2424#include < qpa/qwindowsysteminterface_p.h>
25+
26+ #ifdef USE_DEEPIN_QT
2527#include < private/qwlqtkey_p.h>
2628#include < private/qwlqttouch_p.h>
29+ #endif
2730
2831DGUI_USE_NAMESPACE
2932
@@ -418,11 +421,14 @@ void PluginManager::initialize()
418421 QWindowSystemInterfacePrivate::removeWindowSystemEventhandler (eventHandler);
419422 }
420423
424+ // TODO: Use built-in protocol instead of qt
425+ #ifdef USE_DEEPIN_QT
421426 // 只创建就行
422427 auto qtKey = new QtWayland::QtKeyExtensionGlobal (compositor);
423428 qtKey->setParent (compositor);
424429 auto qtTouch = new QtWayland::TouchExtensionGlobal (compositor);
425430 qtTouch->setParent (compositor);
431+ #endif
426432
427433 init (compositor->display (), 1 );
428434}
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
2+ //
3+ // SPDX-License-Identifier: GPL-3.0-or-later
4+
5+ #include < QtWaylandCompositor/QWaylandSurface>
6+ #include < QtWaylandCompositor/QWaylandResource>
7+ #include < QtWaylandCompositor/QWaylandCompositor>
8+
9+ #define protected public
10+ #include < private/qwaylandcompositor_p.h>
11+ #undef protected
12+ #include < private/qwlqtkey_p.h>
13+ #include < private/qwlqttouch_p.h>
14+
15+ int main (int argc, char *argv[]) {
16+ new QtWayland::QtKeyExtensionGlobal (nullptr );
17+ return 0 ;
18+ }
You can’t perform that action at this time.
0 commit comments