From 45eda0ff75c2b6f02f7a9ea2f30e42c0742946ce Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Dec 2020 16:33:37 +0100 Subject: [PATCH] Warn about using XIM as input method with wxGTK This results in various problems, including both the problems with handling keyboard input (see #16840) and, even less expectedly, graphical issues with flickering (see #18462). Fixing or working around these issues doesn't seem to be easily possible, but we can at least warn people about the problem. Closes https://github.com/wxWidgets/wxWidgets/pull/2138 --- src/gtk/app.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index b524c513a1..afae00e006 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -27,6 +27,7 @@ #include "wx/apptrait.h" #include "wx/fontmap.h" +#include "wx/msgout.h" #include "wx/gtk/private.h" @@ -338,6 +339,18 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) #endif // __UNIX__ + // Using XIM results in many problems, so try to warn people about it. + wxString inputMethod; + if ( wxGetEnv("GTK_IM_MODULE", &inputMethod) && inputMethod == "xim" ) + { + wxMessageOutputStderr().Output + ( + _("WARNING: using XIM input method is unsupported and may result " + "in problems with input handling and flickering. Consider " + "unsetting GTK_IM_MODULE or setting to \"ibus\".") + ); + } + bool init_result; #if wxUSE_UNICODE