diff options
author | Xi Yan | 2018-09-12 15:42:43 +0000 |
---|---|---|
committer | Eric Williams | 2018-09-12 17:10:22 +0000 |
commit | ee007550340c5848c429928a6b9f5903f91073bd (patch) | |
tree | 1ab14cf0b7b5dfe15ea4bf1699223820c4ccb946 | |
parent | 293f8acff257cfd14c8b17937489fc1cd22273b0 (diff) | |
download | eclipse.platform.swt-ee007550340c5848c429928a6b9f5903f91073bd.tar.gz eclipse.platform.swt-ee007550340c5848c429928a6b9f5903f91073bd.tar.xz eclipse.platform.swt-ee007550340c5848c429928a6b9f5903f91073bd.zip |
Bug 517671 - [GTK3] flickering for no reason under Linux
Added checks for GTK_IM_MODULE=xim, prints warning when module is
detected.
Change-Id: Ifc1d801bbeaf8fc3e354b04761067d823b513714
Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index 598b0439fd..a7e3057fbe 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -1015,6 +1015,19 @@ protected void create (DeviceData data) { if (Default == null) Default = this; } +/** + * Check if the XIM module is present and generates a warning for potential graphical issues + * if GTK_IM_MODULE=xim is detected. See Bug 517671. + */ +void checkXimModule () { + Map<String, String> env = System.getenv(); + String module = env.get("GTK_IM_MODULE"); + if (module != null && module.equals("xim")) { + System.err.println("***WARNING: Detected: GTK_IM_MODULE=xim. This input method is unsupported and can cause graphical issues."); + System.err.println("***WARNING: Unset GTK_IM_MODULE or set GTK_IM_MODULE=ibus if flicking is experienced. "); + } +} + void createDisplay (DeviceData data) { if (OS.GLIB_VERSION < OS.VERSION(2, 32, 0)) { /* Required for g_main_context_wakeup */ @@ -1025,6 +1038,7 @@ void createDisplay (DeviceData data) { if (!GTK.gtk_init_check (new long /*int*/ [] {0}, null)) { SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]"); //$NON-NLS-1$ } + checkXimModule(); //set GTK+ Theme name as property for introspection purposes System.setProperty("org.eclipse.swt.internal.gtk.theme", OS.getThemeName()); if (OS.isX11()) xDisplay = GDK.gdk_x11_get_default_xdisplay(); |