Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,32 @@ include(DDEShellPackageMacros)
include(KDEClangFormat)
include(KDEGitCommitHooks)

find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient DBus LinguistTools Sql)
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient WaylandCompositor DBus LinguistTools Sql)
find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui)
find_package(ICU 74.2 REQUIRED COMPONENTS uc i18n io)
find_package(WaylandProtocols REQUIRED)
find_package(PkgConfig REQUIRED)

try_compile(COMPILE_RESULT
${CMAKE_CURRENT_BINARY_DIR}/try_compile_build
SOURCES ${CMAKE_SOURCE_DIR}/tests/check/qt_wayland_keyextension.cpp
LINK_LIBRARIES
Qt${QT_VERSION_MAJOR}::WaylandCompositorPrivate
Qt${QT_VERSION_MAJOR}::WaylandCompositor
COMPILE_DEFINITIONS
-DQT_WAYLANDCOMPOSITOR_LIB
-DQT_WAYLANDCOMPOSITORPRIVATE_LIB
-DQT_WAYLANDCOMPOSITOR_IMPLEMENTATION
OUTPUT_VARIABLE compile_output
)

if(COMPILE_RESULT)
message(STATUS "Deepin Qt detected (try_compile success)")
add_definitions(-DUSE_DEEPIN_QT)
else()
message(STATUS "Deepin Qt not detected")
endif()

add_subdirectory(frame)
add_subdirectory(shell)
add_subdirectory(example)
Expand Down
6 changes: 6 additions & 0 deletions panels/dock/pluginmanagerextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
#include <QJsonParseError>

#define protected public
#include <private/qwaylandcompositor_p.h>

Check warning on line 22 in panels/dock/pluginmanagerextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwaylandcompositor_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#undef protected
#include <qpa/qwindowsysteminterface_p.h>

Check warning on line 24 in panels/dock/pluginmanagerextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <qpa/qwindowsysteminterface_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#ifdef USE_DEEPIN_QT
#include <private/qwlqtkey_p.h>

Check warning on line 27 in panels/dock/pluginmanagerextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwlqtkey_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <private/qwlqttouch_p.h>

Check warning on line 28 in panels/dock/pluginmanagerextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwlqttouch_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif

DGUI_USE_NAMESPACE

Expand Down Expand Up @@ -418,11 +421,14 @@
QWindowSystemInterfacePrivate::removeWindowSystemEventhandler(eventHandler);
}

// TODO: Use built-in protocol instead of qt
#ifdef USE_DEEPIN_QT
// 只创建就行
auto qtKey = new QtWayland::QtKeyExtensionGlobal(compositor);
qtKey->setParent(compositor);
auto qtTouch = new QtWayland::TouchExtensionGlobal(compositor);
qtTouch->setParent(compositor);
#endif

init(compositor->display(), 1);
}
Expand Down
18 changes: 18 additions & 0 deletions tests/check/qt_wayland_keyextension.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include <QtWaylandCompositor/QWaylandSurface>

Check warning on line 5 in tests/check/qt_wayland_keyextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtWaylandCompositor/QWaylandSurface> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtWaylandCompositor/QWaylandResource>

Check warning on line 6 in tests/check/qt_wayland_keyextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtWaylandCompositor/QWaylandResource> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtWaylandCompositor/QWaylandCompositor>

Check warning on line 7 in tests/check/qt_wayland_keyextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtWaylandCompositor/QWaylandCompositor> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#define protected public
#include <private/qwaylandcompositor_p.h>

Check warning on line 10 in tests/check/qt_wayland_keyextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwaylandcompositor_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#undef protected
#include <private/qwlqtkey_p.h>

Check warning on line 12 in tests/check/qt_wayland_keyextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwlqtkey_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <private/qwlqttouch_p.h>

Check warning on line 13 in tests/check/qt_wayland_keyextension.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwlqttouch_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

int main (int argc, char *argv[]) {
new QtWayland::QtKeyExtensionGlobal(nullptr);
return 0;
}