[libegg] Check for X11 backend at runtime in the xsmp client



commit 7ceb9c1fb72f21f8887d25bbba1360b8ed56a0a7
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Sep 28 12:30:52 2011 +0200

    Check for X11 backend at runtime in the xsmp client
    
    Without this we will crash if you're running a broadway app from
    inside a X11 session.

 libegg/smclient/eggsmclient-xsmp.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libegg/smclient/eggsmclient-xsmp.c b/libegg/smclient/eggsmclient-xsmp.c
index 9fd1e5d..d5cf3b5 100644
--- a/libegg/smclient/eggsmclient-xsmp.c
+++ b/libegg/smclient/eggsmclient-xsmp.c
@@ -193,6 +193,11 @@ egg_sm_client_xsmp_class_init (EggSMClientXSMPClass *klass)
 EggSMClient *
 egg_sm_client_xsmp_new (void)
 {
+#if GTK_CHECK_VERSION(3,0,0)
+  if (!GDK_IS_X11_DISPLAY_MANAGER (gdk_display_manager_get ()))
+    return NULL;
+#endif
+
   if (!g_getenv ("SESSION_MANAGER"))
     return NULL;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]