summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkdisplay-wayland.c
diff options
context:
space:
mode:
authorMario Sanchez Prada <msanchez@gnome.org>2018-06-11 16:09:06 +0100
committerMario Sanchez Prada <msanchez@gnome.org>2018-06-11 16:28:24 +0100
commitef3427575fe49c19f35defd292d647c0792e2fc4 (patch)
tree55c39b956650d7a51eb6853e4193fc04c9c6225a /gdk/wayland/gdkdisplay-wayland.c
parent33b8f087a3b32b9e40fce3b4efc413f4c0e066c8 (diff)
downloadgtk+-ef3427575fe49c19f35defd292d647c0792e2fc4.tar.gz
display: Avoid unsetting the DESKTOP_STARTUP_ID variable too late
Similar to what has been done recently for DESKTOP_AUTOSTART_ID [1], we need to get rid of this call to g_unsetenv() in the displays' backends for X11 and Wayland, so that it's guarantee to happen any thread is created, while still being accessible when needed. Let's stash the value of this environment variable when loading the GDK library, and provide a private method so that it can be retrieved from the displays' backend when implementing gdk_display_make_default(). [1] https://gitlab.gnome.org/GNOME/gtk/commit/22269902 Closes: https://gitlab.gnome.org/GNOME/gtk/issues/979
Diffstat (limited to 'gdk/wayland/gdkdisplay-wayland.c')
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 3fb9fda050..2f46817be4 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -54,6 +54,8 @@
#include "wm-button-layout-translation.h"
+#include "gdk/gdk-private.h"
+
/**
* SECTION:wayland_interaction
* @Short_description: Wayland backend-specific functions
@@ -817,19 +819,9 @@ gdk_wayland_display_make_default (GdkDisplay *display)
g_free (display_wayland->startup_notification_id);
display_wayland->startup_notification_id = NULL;
- startup_id = g_getenv ("DESKTOP_STARTUP_ID");
- if (startup_id && *startup_id != '\0')
- {
- if (!g_utf8_validate (startup_id, -1, NULL))
- g_warning ("DESKTOP_STARTUP_ID contains invalid UTF-8");
- else
- display_wayland->startup_notification_id = g_strdup (startup_id);
-
- /* Clear the environment variable so it won't be inherited by
- * child processes and confuse things.
- */
- g_unsetenv ("DESKTOP_STARTUP_ID");
- }
+ startup_id = gdk_get_startup_notification_id ();
+ if (startup_id)
+ display_wayland->startup_notification_id = g_strdup (startup_id);
}
static gboolean