mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 07:30:42 -05:00
core: Set timestamp in our DESKTOP_STARTUP_ID tokens
We must be educated to X11 clients (which usually parse the timestamp from the DESKTOP_STARTUP_ID, and request focus with it) to make focus stealing prevention work across the board. To wayland clients the startup ID should be as opaque and meaningless as it was before. https://gitlab.gnome.org/GNOME/mutter/merge_requests/540
This commit is contained in:
parent
217bd31531
commit
aea56b6f55
@ -119,6 +119,18 @@ meta_launch_context_constructed (GObject *object)
|
||||
"WAYLAND_DISPLAY", getenv ("WAYLAND_DISPLAY"));
|
||||
}
|
||||
|
||||
static gchar *
|
||||
create_startup_notification_id (uint32_t timestamp)
|
||||
{
|
||||
gchar *uuid, *id;
|
||||
|
||||
uuid = g_uuid_string_random ();
|
||||
id = g_strdup_printf ("%s_TIME%u", uuid, timestamp);
|
||||
g_free (uuid);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
|
||||
GAppInfo *info,
|
||||
@ -137,7 +149,7 @@ meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
|
||||
MetaStartupNotification *sn;
|
||||
MetaStartupSequence *seq;
|
||||
|
||||
startup_id = g_uuid_string_random ();
|
||||
startup_id = create_startup_notification_id (context->timestamp);
|
||||
|
||||
/* Fallback through inserting our own startup sequence, this
|
||||
* will be enough for wayland clients.
|
||||
|
Loading…
Reference in New Issue
Block a user