Blame SOURCES/Return-error-if-X11-is-not-detected.patch

ee1027
From d5b743b11a6f102353af719fa34abd5e6c679e77 Mon Sep 17 00:00:00 2001
ee1027
From: Ondrej Holy <oholy@redhat.com>
ee1027
Date: Tue, 20 Feb 2018 12:26:18 +0100
ee1027
Subject: [PATCH] Return error if X11 is not detected
ee1027
ee1027
Vino-server crashes on Wayland in XQueryExtension. Since vino-server is
ee1027
not expected to work on displays other than X11, let's exit immediately
ee1027
if GDK_IS_X11_DISPLAY fail.
ee1027
ee1027
https://bugzilla.gnome.org/show_bug.cgi?id=761120
ee1027
---
ee1027
 server/vino-main.c | 7 +++++++
ee1027
 1 file changed, 7 insertions(+)
ee1027
ee1027
diff --git a/server/vino-main.c b/server/vino-main.c
ee1027
index dd95de7..7be3fff 100644
ee1027
--- a/server/vino-main.c
ee1027
+++ b/server/vino-main.c
ee1027
@@ -28,6 +28,7 @@
ee1027
 #include <glib/gi18n.h>
ee1027
 #include <gtk/gtk.h>
ee1027
 #include <locale.h>
ee1027
+#include <gdk/gdkx.h>
ee1027
 
ee1027
 #include "vino-input.h"
ee1027
 #include "vino-mdns.h"
ee1027
@@ -273,6 +274,12 @@ main (int argc, char **argv)
ee1027
     g_option_context_free (context);
ee1027
   }
ee1027
 
ee1027
+  if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
ee1027
+    {
ee1027
+      g_printerr ("X11 is not detected\n");
ee1027
+      return 1;
ee1027
+    }
ee1027
+
ee1027
   /* GSettings */
ee1027
   vino.settings = g_settings_new ("org.gnome.Vino");
ee1027
 
ee1027
-- 
ee1027
2.17.0
ee1027