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

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