GtkApplication: avoid using stale timestamps
authorRyan Lortie <desrt@desrt.ca>
Mon, 6 Jul 2015 18:08:11 +0000 (14:08 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 15 Jul 2015 01:34:09 +0000 (18:34 -0700)
commita00a5ed2104b516200c13c40be3ffa174d87fd91
treec1020275244ea74234f7681ffa10041bca8b3b40
parent18dbe181fb13571ecbc76ce7f7f28c36c557a3d6
GtkApplication: avoid using stale timestamps

Avoid using a stale timestamp (from the last user interaction with the
application) when a message arrives from D-Bus requesting that a new
window be created.

In this case the most-correct thing that we can do is to use no
timestamp at all.

We modify gdk_x11_display_set_startup_notification_id() to allow a NULL
value to mean "reset everything" and then call this function
unconditionally on receipt of D-Bus activation requests.  The result
will be that a missing desktop-startup-id in the platform-data struct
will reset the timestamp.

Under their default configuration metacity and mutter will both map
windows presented with no timestamp in the foreground.  This could
result in false-positive, but there is very little we can do about that
without the original timestamp from the user event.

https://bugzilla.gnome.org/show_bug.cgi?id=752000
gdk/x11/gdkdisplay-x11.c
gtk/gtkapplication-x11.c