diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-02-23 17:14:37 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-02-23 17:14:37 +0100 |
commit | 9892189d2e7ab94b750f99e6da4cbfc3c8014517 (patch) | |
tree | 18634bacebb9e922feceff40c924cdc48550d7ac /src/mbyte.c | |
parent | 6bd364e08461159ad3c153ffba4def5b896486a1 (diff) |
patch 7.4.1402v7.4.1402
Problem: GTK 3 is not supported.
Solution: Add GTK 3 support. (Kazunobu Kuriyama)
Diffstat (limited to 'src/mbyte.c')
-rw-r--r-- | src/mbyte.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mbyte.c b/src/mbyte.c index 16092843b8..b44168ded3 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -109,7 +109,11 @@ #endif #if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) -# include <gdk/gdkkeysyms.h> +# if GTK_CHECK_VERSION(3,0,0) +# include <gdk/gdkkeysyms-compat.h> +# else +# include <gdk/gdkkeysyms.h> +# endif # ifdef WIN3264 # include <gdk/gdkwin32.h> # else @@ -4941,7 +4945,11 @@ xim_init(void) #endif g_return_if_fail(gui.drawarea != NULL); +#if GTK_CHECK_VERSION(3,0,0) + g_return_if_fail(gtk_widget_get_window(gui.drawarea) != NULL); +#else g_return_if_fail(gui.drawarea->window != NULL); +#endif xic = gtk_im_multicontext_new(); g_object_ref(xic); @@ -4955,7 +4963,11 @@ xim_init(void) g_signal_connect(G_OBJECT(xic), "preedit_end", G_CALLBACK(&im_preedit_end_cb), NULL); +#if GTK_CHECK_VERSION(3,0,0) + gtk_im_context_set_client_window(xic, gtk_widget_get_window(gui.drawarea)); +#else gtk_im_context_set_client_window(xic, gui.drawarea->window); +#endif } void @@ -5054,12 +5066,21 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state) # ifdef HAVE_GTK_MULTIHEAD event = (GdkEventKey *)gdk_event_new(GDK_KEY_PRESS); +# if GTK_CHECK_VERSION(3,0,0) + g_object_ref(gtk_widget_get_window(gui.drawarea)); + /* unreffed by gdk_event_free() */ +# else g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */ +# endif # else event = (GdkEventKey *)g_malloc0((gulong)sizeof(GdkEvent)); event->type = GDK_KEY_PRESS; # endif +# if GTK_CHECK_VERSION(3,0,0) + event->window = gtk_widget_get_window(gui.drawarea); +# else event->window = gui.drawarea->window; +# endif event->send_event = TRUE; event->time = GDK_CURRENT_TIME; event->state = state; |