[gtk+] GdkAppLaunchContext: Set DISPLAY variable for X11



commit ecb0e777fa4b07cf87c41fda4838ebf6448694c5
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Tue Sep 15 14:17:05 2015 +0200

    GdkAppLaunchContext: Set DISPLAY variable for X11
    
    The environment variable DISPLAY makes sense only for X11, so set its
    value in the X11 backend.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754983

 gdk/x11/gdkapplaunchcontext-x11.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index 6e816e4..e82f578 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -463,10 +463,17 @@ GdkAppLaunchContext *
 _gdk_x11_display_get_app_launch_context (GdkDisplay *display)
 {
   GdkAppLaunchContext *ctx;
+  static gchar *display_name;
 
   ctx = g_object_new (GDK_TYPE_X11_APP_LAUNCH_CONTEXT,
                       "display", display,
                       NULL);
 
+  display_name = g_app_launch_context_get_display (G_APP_LAUNCH_CONTEXT (ctx),
+                                                   NULL, NULL);
+  if (display_name)
+    g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx),
+                                 "DISPLAY", display_name);
+
   return ctx;
 }


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