summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmintegration.cpp
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2023-12-18 14:57:28 +0800
committerJiDe Zhang <zhangjide@uniontech.com>2024-03-05 12:26:10 +0800
commit8596998cb025a8338c9403f5ef9db5a23f5cc682 (patch)
treebae414b15b5adc0524d4e4bb6c0b1a2e35f13fe8 /src/plugins/platforms/wasm/qwasmintegration.cpp
parentca4774131b9b8ee40b4d7f5c1ba296af4700207f (diff)
Add QT_IM_MODULES env to allows specify multi IM key
Like as QT_QPA_PLATFORM, supports specifying multiple keys, and can perform fallback operations to prioritize the use of a certain plug-in. This is useful when using Wayland and XWayland applications at the same time. For an example, we can set "QT_IM_MODULES=wayland;fcitx", and the wayland application will use the wayland input context plugin, the xwayland application will use fcitx, which can't be done without adding a new environment variable, if we specify "QT_IM_MODULE=wayland", the XWayland applications may not be able to use the input method. Fixes: QTBUG-120202 Change-Id: Iac408af241963147747a2fe685f1e27bf9d9ee64 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp
index d2e7c8716c..01367bd56b 100644
--- a/src/plugins/platforms/wasm/qwasmintegration.cpp
+++ b/src/plugins/platforms/wasm/qwasmintegration.cpp
@@ -222,12 +222,12 @@ QPlatformOpenGLContext *QWasmIntegration::createPlatformOpenGLContext(QOpenGLCon
void QWasmIntegration::initialize()
{
- if (qgetenv("QT_IM_MODULE").isEmpty() && touchPoints < 1)
+ auto icStrs = QPlatformInputContextFactory::requested();
+ if (icStrs.isEmpty() && touchPoints < 1)
return;
- QString icStr = QPlatformInputContextFactory::requested();
- if (!icStr.isNull())
- m_inputContext.reset(QPlatformInputContextFactory::create(icStr));
+ if (!icStrs.isEmpty())
+ m_inputContext.reset(QPlatformInputContextFactory::create(icStrs));
else
m_inputContext.reset(new QWasmInputContext());
}