Skip to content

Commit 96d0943

Browse files
committed
feat: force QT_IM_MODULE=wayland for plugin process to enable Chinese input
The plugin process connects to the internal dockplugin compositor and cannot directly access the system fcitx/ibus DBus interfaces. Force the use of the native Wayland text_input protocol so that IME requests are properly proxied by the dockplugin compositor (via zwp_text_input) to the outer real compositor, enabling Chinese input in plugin windows. feat: force QT_IM_MODULE=wayland for plugin process to enable Chinese input Pms: BUG-323547
1 parent e82424b commit 96d0943

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/loader/main.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -94,11 +94,19 @@ int main(int argc, char *argv[], char *envp[])
9494
oldEnvs["WAYLAND_DISPLAY"] = qgetenv("WAYLAND_DISPLAY");
9595
oldEnvs["QT_WAYLAND_SHELL_INTEGRATION"] = qgetenv("QT_WAYLAND_SHELL_INTEGRATION");
9696
oldEnvs["QT_WAYLAND_RECONNECT"] = qgetenv("QT_WAYLAND_RECONNECT");
97+
oldEnvs["QT_IM_MODULE"] = qgetenv("QT_IM_MODULE");
9798

9899
qputenv("DSG_APP_ID", "org.deepin.dde.tray-loader");
99100
qputenv("WAYLAND_DISPLAY", "dockplugin");
100101
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "plugin-shell");
101102
qputenv("QT_WAYLAND_RECONNECT", "1");
103+
// Force native Wayland text_input protocol as the input method channel.
104+
// The plugin process connects to the internal dockplugin compositor and cannot
105+
// directly access the system fcitx/ibus DBus interfaces.
106+
// The dockplugin compositor proxies IME requests to the outer real compositor
107+
// via the zwp_text_input family of protocols.
108+
qputenv("QT_IM_MODULE", "wayland");
109+
102110

103111
qAddPreRoutine([] () {
104112
if (!DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::IsXWindowPlatform)) {

0 commit comments

Comments
 (0)