Control: tags 819954 + patch upstream

On Mon, 04 Apr 2016 at 10:03:48 +0100, Simon McVittie wrote:
> vim appears to assume that Gtk implies X11, so until/unless that assumption
> can be disentangled, it should force the use of the X11 backend by putting
> 
>     gdk_set_allowed_backends ("x11");
> 
> before the first call to gdk_display_open(), gtk_init() or gtk_init_*().

The attached patch seems to work.

    S
>From 1af0df914302846910fe9a7baac1d91f6d88113f Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Mon, 4 Apr 2016 10:34:59 +0100
Subject: [PATCH] gui_gtk_x11: explicitly disable non-X11 Gtk3 backends

Signed-off-by: Simon McVittie <[email protected]>
---
 debian/changelog  | 7 +++++++
 src/gui_gtk_x11.c | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 117b314..6c4c7c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+vim (2:7.4.1689-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * gui_gtk_x11: explicitly disable non-X11 Gtk3 backends (Closes: #819954)
+
+ -- Simon McVittie <[email protected]>  Mon, 04 Apr 2016 10:26:14 +0100
+
 vim (2:7.4.1689-2) unstable; urgency=medium
 
   * Stop installing a dangling symlink at
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index aa4137a..6c37ba5 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -1679,6 +1679,12 @@ gui_mch_init_check(void)
     }
 #endif
 
+#if GTK_CHECK_VERSION(3,0,0)
+    /* vim currently assumes that Gtk means X11, so it cannot use native Gtk
+     * support for other backends such as Wayland. */
+    gdk_set_allowed_backends ("x11");
+#endif
+
 #ifdef FEAT_GUI_GNOME
     if (gtk_socket_id == 0)
 	using_gnome = 1;
-- 
2.8.0.rc3

Reply via email to