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,35 @@ 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+ set (TEST_SOURCE "${CMAKE_CURRENT_BINARY_DIR } /test_deepin_qt.cpp" )
62+ configure_file (${CMAKE_CURRENT_SOURCE_DIR } /tests/check/main.cpp ${TEST_SOURCE} COPYONLY )
63+
64+ try_compile (COMPILE_RESULT
65+ ${CMAKE_CURRENT_BINARY_DIR } /try_compile_build # Build directory
66+ SOURCES ${TEST_SOURCE} # Test source file
67+ LINK_LIBRARIES
68+ Qt${QT_VERSION_MAJOR}::WaylandCompositorPrivate
69+ Qt${QT_VERSION_MAJOR}::WaylandCompositor
70+ COMPILE_DEFINITIONS
71+ -DQT_WAYLANDCOMPOSITOR_LIB
72+ -DQT_WAYLANDCOMPOSITORPRIVATE_LIB
73+ -DQT_WAYLANDCOMPOSITOR_IMPLEMENTATION
74+ OUTPUT_VARIABLE compile_output
75+ )
76+
77+ if (COMPILE_RESULT)
78+ message (STATUS "Deepin Qt detected (try_compile success)" )
79+ add_definitions (-DUSE_DEEPIN_QT )
80+ else ()
81+ message (STATUS "Deepin Qt not detected" )
82+ endif ()
83+
6184add_subdirectory (frame )
6285add_subdirectory (shell )
6386add_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+ #include < QtWaylandCompositor/QWaylandSurface>
2+ #include < QtWaylandCompositor/QWaylandResource>
3+ #include < QtWaylandCompositor/QWaylandCompositor>
4+
5+ #define protected public
6+ #include < private/qwaylandcompositor_p.h>
7+ #undef protected
8+ #include < private/qwlqtkey_p.h>
9+ #include < private/qwlqttouch_p.h>
10+
11+ int main (int argc, char *argv[]) {
12+ new QtWayland::QtKeyExtensionGlobal (nullptr );
13+ return 0 ;
14+ }
You can’t perform that action at this time.
0 commit comments