Skip to content

Commit e4fc88a

Browse files
committed
[GTK3] Override gtk_im_module only if it was set to xim
From ibus/ibus#2331 (comment) "There are two modes to communicate between IBus and GTK applications." - GTK_IM_MODULE=wayland (composer mode - GNOME Wayland default) and GTK_IM_MODULE=ibus (no composer mode). Note that "wayland" im module is another incarnation of ibus. The only thing that was broken for sure is "xim" so override only it under Gnome on X11 to prevent making SWT(and as a result Eclipse) use non-default IM modules and thus exposing different behaviour than other apps.
1 parent 536fea8 commit e4fc88a

File tree

1 file changed

+6
-6
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+6
-6
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,12 +1143,12 @@ void checkIMModule () {
11431143
if (module != null && module.equals("xim")) {
11441144
System.err.println("***WARNING: Detected: GTK_IM_MODULE=xim. This input method is unsupported and can cause graphical issues.");
11451145
System.err.println("***WARNING: Unset GTK_IM_MODULE or set GTK_IM_MODULE=ibus if flicking is experienced. ");
1146-
}
1147-
// Enforce ibus as the input module on GNOME
1148-
if (OS.isGNOME) {
1149-
long settings = GTK.gtk_settings_get_default ();
1150-
byte[] ibus = Converter.wcsToMbcs ("ibus", true);
1151-
if (settings != 0) OS.g_object_set (settings, GTK.gtk_im_module, ibus, 0);
1146+
// Enforce ibus as the input module on GNOME X11
1147+
if (OS.isGNOME && OS.isX11()) {
1148+
long settings = GTK.gtk_settings_get_default ();
1149+
byte[] ibus = Converter.wcsToMbcs ("ibus", true);
1150+
if (settings != 0) OS.g_object_set (settings, GTK.gtk_im_module, ibus, 0);
1151+
}
11521152
}
11531153
}
11541154

0 commit comments

Comments
 (0)