Mercurial > vim
diff src/mbyte.c @ 8218:3456e2ebebd4 v7.4.1402
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 23 17:14:37 2016 +0100
patch 7.4.1402
Problem: GTK 3 is not supported.
Solution: Add GTK 3 support. (Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 23 Feb 2016 17:15:05 +0100 |
parents | 05b88224cea1 |
children | 54ac275e3fc4 |
line wrap: on
line diff
--- 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 keyv # 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;