patch 7.4.1402
Problem: GTK 3 is not supported.
Solution: Add GTK 3 support. (Kazunobu Kuriyama)
diff --git a/src/channel.c b/src/channel.c
index e9068fe..c59758d 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -361,6 +361,17 @@
#endif
#ifdef FEAT_GUI_GTK
+# if GTK_CHECK_VERSION(3,0,0)
+ static gboolean
+messageFromNetbeans(GIOChannel *unused1 UNUSED,
+ GIOCondition unused2 UNUSED,
+ gpointer clientData)
+{
+ channel_read_fd(GPOINTER_TO_INT(clientData));
+ return TRUE; /* Return FALSE instead in case the event source is to
+ * be removed after this function returns. */
+}
+# else
static void
messageFromNetbeans(gpointer clientData,
gint unused1 UNUSED,
@@ -368,6 +379,7 @@
{
channel_read_fd((int)(long)clientData);
}
+# endif
#endif
static void
@@ -388,12 +400,27 @@
/* Tell gdk we are interested in being called when there
* is input on the editor connection socket. */
if (channel->ch_part[part].ch_inputHandler == 0)
+# if GTK_CHECK_VERSION(3,0,0)
+ {
+ GIOChannel *chnnl = g_io_channel_unix_new(
+ (gint)channel->ch_part[part].ch_fd);
+
+ channel->ch_part[part].ch_inputHandler = g_io_add_watch(
+ chnnl,
+ G_IO_IN|G_IO_HUP|G_IO_ERR|G_IO_PRI,
+ messageFromNetbeans,
+ GINT_TO_POINTER(channel->ch_part[part].ch_fd));
+
+ g_io_channel_unref(chnnl);
+ }
+# else
channel->ch_part[part].ch_inputHandler = gdk_input_add(
(gint)channel->ch_part[part].ch_fd,
(GdkInputCondition)
((int)GDK_INPUT_READ + (int)GDK_INPUT_EXCEPTION),
messageFromNetbeans,
(gpointer)(long)channel->ch_part[part].ch_fd);
+# endif
# else
# ifdef FEAT_GUI_W32
/* Tell Windows we are interested in receiving message when there
@@ -457,7 +484,11 @@
# ifdef FEAT_GUI_GTK
if (channel->ch_part[part].ch_inputHandler != 0)
{
+# if GTK_CHECK_VERSION(3,0,0)
+ g_source_remove(channel->ch_part[part].ch_inputHandler);
+# else
gdk_input_remove(channel->ch_part[part].ch_inputHandler);
+# endif
channel->ch_part[part].ch_inputHandler = 0;
}
# else
@@ -606,7 +637,7 @@
fd_set wfds;
#if defined(__APPLE__) && __APPLE__ == 1
# define PASS_RFDS
- fd_set rfds;
+ fd_set rfds;
FD_ZERO(&rfds);
FD_SET(sd, &rfds);