diff options
author | B. Watson <yalhcru@gmail.com> | 2017-06-25 02:49:12 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-07-01 07:42:25 +0700 |
commit | a2ca8e357f346aaab5c079649b7f0ab99b6a584f (patch) | |
tree | 4b00478d142a2c1ffe36776f6cc47f89273ee864 /network/surf/getkbdevice.diff | |
parent | 218b6c3c8a1726e7cc6490e1b93bcbb34753dab0 (diff) | |
download | slackbuilds-a2ca8e357f346aaab5c079649b7f0ab99b6a584f.tar.gz |
network/surf: Updated for version 2.0.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'network/surf/getkbdevice.diff')
-rw-r--r-- | network/surf/getkbdevice.diff | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/network/surf/getkbdevice.diff b/network/surf/getkbdevice.diff new file mode 100644 index 0000000000..14bef9460d --- /dev/null +++ b/network/surf/getkbdevice.diff @@ -0,0 +1,61 @@ +diff -Naur surf-2.0/surf.c surf-2.0.patched/surf.c +--- surf-2.0/surf.c 2017-03-28 12:17:45.000000000 -0400 ++++ surf-2.0.patched/surf.c 2017-06-25 01:23:41.445168316 -0400 +@@ -174,6 +174,7 @@ + static void cleanup(void); + + /* GTK/WebKit */ ++static GdkDevice *getkbdevice(void); + static WebKitWebView *newview(Client *c, WebKitWebView *rv); + static void initwebextensions(WebKitWebContext *wc, Client *c); + static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, +@@ -263,7 +264,6 @@ + void + setup(void) + { +- GdkDisplay *gdpy; + int i, j; + + /* clean up any zombies immediately */ +@@ -281,8 +281,6 @@ + + gtk_init(NULL, NULL); + +- gdpy = gdk_display_get_default(); +- + curconfig = defconfig; + + /* dirs and files */ +@@ -290,7 +288,7 @@ + scriptfile = buildfile(scriptfile); + cachedir = buildpath(cachedir); + +- gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); ++ gdkkb = getkbdevice(); + + if (!stylefile) { + styledir = buildpath(styledir); +@@ -329,6 +327,23 @@ + } + } + ++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; ++} ++ ++ + void + sigchld(int unused) + { |