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
1 change: 1 addition & 0 deletions panels/dock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ target_link_libraries(dock-plugin PUBLIC
PRIVATE
PkgConfig::WaylandClient
Qt${QT_VERSION_MAJOR}::WaylandCompositorPrivate
Qt${QT_VERSION_MAJOR}::GuiPrivate
)

target_include_directories(dock-plugin
Expand Down
25 changes: 25 additions & 0 deletions panels/dock/pluginmanagerextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@
#include <QtWaylandCompositor/QWaylandResource>
#include <QtWaylandCompositor/QWaylandCompositor>

#include <QJsonObject>

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

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QJsonObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QJsonParseError>

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

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QJsonParseError> 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 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.
#include <private/qwlqtkey_p.h>

Check warning on line 25 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 26 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.

DGUI_USE_NAMESPACE

PluginScaleManager::PluginScaleManager(QWaylandCompositor *compositor)
Expand Down Expand Up @@ -394,6 +401,24 @@
{
QWaylandCompositorExtensionTemplate::initialize();
QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(extensionContainer());

// ###(zccrs): 在dde-shell中不要使用QWaylandCompositor的event handler,它会对key event进行
// 特殊处理,会丢弃掉原生事件的信息,仅根据 native scan key code 通过xkb生成原始key event向
// dde-shell 传递,这会导致需要状态切换后进行输入的字符丢失信息,比如外部环境打开NumLock后,小键盘
// 的数字输入会被event handler转成原始事件,丢失了NumLock的开关信息。
// dde-shell不是一个独立的合成器,所以不需要额外处理key event,需要遵守原始事件中的NumLock状态
// 确保输出数字时在dde-shell的wayland客户端中接收到的也是数字。
auto eventHandler = QWaylandCompositorPrivate::get(compositor)->eventHandler.get();
if (eventHandler == QWindowSystemInterfacePrivate::eventHandler) {
QWindowSystemInterfacePrivate::removeWindowSystemEventhandler(eventHandler);
}

// 只创建就行
auto qtKey = new QtWayland::QtKeyExtensionGlobal(compositor);
qtKey->setParent(compositor);
auto qtTouch = new QtWayland::TouchExtensionGlobal(compositor);
qtTouch->setParent(compositor);

init(compositor->display(), 1);
}

Expand Down