--- surf.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/surf.c b/surf.c index 29b9ede..e8ccaa6 100644 --- a/surf.c +++ b/surf.c _AT_@ -174,6 +174,7 @@ static void destroyclient(Client *c); static void cleanup(void); /* GTK/WebKit */ +static GdkDevice *getkbdevice(void); static WebKitWebView *newview(Client *c, WebKitWebView *rv); static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c); _AT_@ -287,7 +288,7 @@ setup(void) scriptfile = buildfile(scriptfile); cachedir = buildpath(cachedir); - gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); + gdkkb = getkbdevice(); if (!stylefile) { styledir = buildpath(styledir); _AT_@ -902,6 +903,22 @@ cleanup(void) g_free(cachedir); } +static GdkDevice * +getkbdevice(void) +{ + GList *l, *gdl = gdk_device_manager_list_devices( + gdk_display_get_device_manager(gdk_display_get_default()), + GDK_DEVICE_TYPE_MASTER); + GdkDevice *gd = NULL; + + for (l = gdl; l != NULL; l = l->next) + if (gdk_device_get_source(l->data) == GDK_SOURCE_KEYBOARD) + gd = l->data; + + g_list_free(gdl); + return gd; +} + WebKitWebView * newview(Client *c, WebKitWebView *rv) { -- 2.1.4 --k1lZvvs/B4yU6o8G--Received on Mon Sep 17 2001 - 00:00:00 CEST
This archive was generated by hypermail 2.3.0 : Thu Aug 18 2016 - 12:12:13 CEST