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
This commit is contained in:
Vadim Zeitlin
2020-12-07 16:33:37 +01:00
parent 8bf8cf4aae
commit 45eda0ff75

View File

@@ -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