From 07631f2ef00a52d883d0fd47ff7d1e1a6bc6358f Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Fri, 30 Jun 2023 09:44:37 +0200 Subject: [PATCH] Ignore InputMethod=qtvirtualkeyboard on wayland Using QT_IM_MODULE=qtvirtualkeyboard in wayland client applications is not supported by Qt, but is sddm's builtin default. Avoid setting that. --- src/greeter/GreeterApp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp index 4e4f65301..01613cc66 100644 --- a/src/greeter/GreeterApp.cpp +++ b/src/greeter/GreeterApp.cpp @@ -351,8 +351,14 @@ int main(int argc, char **argv) qputenv("KDE_DEBUG", "1"); // Qt IM module - if (!SDDM::mainConfig.InputMethod.get().isEmpty()) - qputenv("QT_IM_MODULE", SDDM::mainConfig.InputMethod.get().toLocal8Bit().constData()); + QString inputMethod = SDDM::mainConfig.InputMethod.get(); + // Using qtvirtualkeyboard as IM on wayland doesn't really work, + // it has to be done by the compositor instead. + if (platform.startsWith(QStringLiteral("wayland")) && inputMethod == QStringLiteral("qtvirtualkeyboard")) + inputMethod = QString{}; + + if (!inputMethod.isEmpty()) + qputenv("QT_IM_MODULE", inputMethod.toLocal8Bit()); QGuiApplication app(argc, argv); SDDM::SignalHandler s;