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

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