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

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