Permalink
Browse files

client/gtk2: Fix SEGV with Wayland display

Delete gdk_display_get_name() in GTK clients because ibus-daemon
does not use gdk_display_get_name().
GdkX11Dislay and GdkX11Window does not work with Wayland.

BUG=#1859
R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/301760043
  • Loading branch information...
fujiwarat committed Jun 3, 2016
1 parent a186059 commit 3ef21fef0135f7b4fe9611d201f15611734f6c51
Showing with 5 additions and 7 deletions.
  1. +0 −5 client/gtk2/ibusimcontext.c
  2. +5 −2 setup/main.py
@@ -583,11 +583,6 @@ ibus_im_context_class_init (IBusIMContextClass *class)
/* init bus object */
if (_bus == NULL) {
- const gchar *dname = gdk_display_get_name (gdk_display_get_default ());
- /* ibus-daemon uses DISPLAY variable. */
- if (g_strcmp0 (dname, "Wayland") == 0)
- dname = g_getenv ("DISPLAY");
- ibus_set_display (dname);
_bus = ibus_bus_new_async ();
/* init the global fake context */
View
@@ -275,8 +275,11 @@ def __init_ui(self):
self.__init_general()
def __gdk_window_set_cb(self, object, pspec):
- str = '%u' % GdkX11.X11Window.get_xid(object.get_window())
- GLib.setenv('IBUS_SETUP_XID', str, True)
+ window = object.get_window()
+ if type(window) != GdkX11.X11Window:
+ return
+ s = '%u' % GdkX11.X11Window.get_xid(window)
+ GLib.setenv('IBUS_SETUP_XID', s, True)
def __combobox_notify_active_engine_cb(self, combobox, property):
engine = self.__combobox.get_active_engine()

0 comments on commit 3ef21fe

Please sign in to comment.