diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2015-10-12 16:11:11 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2015-10-13 08:39:05 +0200 |
commit | 4398e1246955546c76d7d690cb84b4fa3df03069 (patch) | |
tree | 8e7b9b7f00d862d0fd180a32d1b6ec0527a83f9b | |
parent | ab001d01c8274013e66d29a6e58275d819845c3c (diff) | |
download | gtk+-4398e1246955546c76d7d690cb84b4fa3df03069.tar.gz |
GdkAppLaunchContext: Use the display name for X11
Using a NULL GAppInfo with g_app_launch_context_get_display() will
generate a critical warning in gio.
Use the display name instead as we don't have any valid GAppInfo to pass
to g_app_launch_context_get_display().
bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=756439
-rw-r--r-- | gdk/x11/gdkapplaunchcontext-x11.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c index e82f578057..bb38e62c59 100644 --- a/gdk/x11/gdkapplaunchcontext-x11.c +++ b/gdk/x11/gdkapplaunchcontext-x11.c @@ -463,14 +463,13 @@ GdkAppLaunchContext * _gdk_x11_display_get_app_launch_context (GdkDisplay *display) { GdkAppLaunchContext *ctx; - static gchar *display_name; + const 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); + display_name = gdk_display_get_name (display); if (display_name) g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx), "DISPLAY", display_name); |