Skip to content
Permalink
Browse files

gtk3: support Wayland backend

GitHub: fix #71

Debian: 810739

Reported by Thibaut Girka. Thanks!!!
  • Loading branch information...
kou committed Dec 30, 2017
1 parent e8e41fd commit 06558e571967f3cb989bdb550d1dea05247cc21d
Showing with 23 additions and 1 deletion.
  1. +16 −0 gtk2/immodule/gtk-im-uim.c
  2. +7 −1 gtk2/immodule/key-util-gtk.c
@@ -535,6 +535,22 @@ layout_candwin(IMUIMContext *uic)
gdk_window_get_geometry(uic->win, &x, &y, &width, &height, &depth);
#endif
gdk_window_get_origin(uic->win, &x, &y);
{
GtkWindow *window = NULL;
GdkWindow *gdk_window = uic->win;
while (gdk_window) {
gpointer user_data;
gdk_window_get_user_data(gdk_window, &user_data);
if (user_data && GTK_IS_WINDOW(user_data)) {
window = user_data;
break;
}
gdk_window = gdk_window_get_parent(gdk_window);
}
if (window) {
gtk_window_set_transient_for(GTK_WINDOW(uic->cwin), window);
}
}
uim_cand_win_gtk_layout(uic->cwin, x, y, width, height);
}
}
@@ -319,6 +319,7 @@ im_uim_init_modifier_keys()
#ifdef GDK_WINDOWING_X11
int i, k = 0;
int min_keycode, max_keycode, keysyms_per_keycode = 0;
GdkDisplay *gdk_display;
Display *display;
GSList *mod1_list, *mod2_list, *mod3_list, *mod4_list, *mod5_list;
XModifierKeymap *map;
@@ -329,7 +330,12 @@ im_uim_init_modifier_keys()

mod1_list = mod2_list = mod3_list = mod4_list = mod5_list = NULL;

display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
gdk_display = gdk_display_get_default();
if (!GDK_IS_X11_DISPLAY(gdk_display)) {

This comment has been minimized.

Copy link
@dai-vdr

dai-vdr Jan 6, 2018

Contributor

@kou GDK_IS_X11_DISPLAY causes build error at gtk2. It needs to make gtk3 only building. Coud you please fix it?

uim_pref_gtk-key-util-gtk.o: In function `im_uim_init_modifier_keys':
./gtk2/pref/../immodule/key-util-gtk.c:338: undefined reference to `GDK_IS_X11_DISPLAY'
collect2: error: ld returned 1 exit status

This comment has been minimized.

Copy link
@kou

kou Jan 6, 2018

Author Member

Oops. I've fixed it.

This comment has been minimized.

Copy link
@dai-vdr

dai-vdr Jan 6, 2018

Contributor

thanks! built successfully.

/* TODO: We may need to something for Wayland. */
return;
}
display = GDK_DISPLAY_XDISPLAY(gdk_display);
map = XGetModifierMapping(display);
XDisplayKeycodes(display, &min_keycode, &max_keycode);
sym = XGetKeyboardMapping(display, min_keycode,

0 comments on commit 06558e5

Please sign in to comment.
You can’t perform that action at this time.