summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2007-11-17 20:09:46 +0000
committerElijah Newren <newren@src.gnome.org>2007-11-17 20:09:46 +0000
commitf437a4b4c0684bc1144bbc24dd5b7bd814697d29 (patch)
treedcda5df3d7f694c8d96f3ed582e48254b5c005ea
parent54d6a293bb9c29585501066005dba120562cb3e1 (diff)
downloadmetacity-f437a4b4c0684bc1144bbc24dd5b7bd814697d29.tar.gz
If a window is launched without any kind of launch timestamp, grab the
2007-11-09 Elijah Newren <newren gmail com> * src/window.c (meta_window_new_with_attrs): If a window is launched without any kind of launch timestamp, grab the current time and stash it away. When transients of that window are also launched without a timestamp, we can use the stashed timestamp from the parent. Fixes #488468. svn path=/branches/gnome-2-20/; revision=3407
-rw-r--r--ChangeLog8
-rw-r--r--src/window.c27
2 files changed, 35 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 370e5187..9351c980 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-09 Elijah Newren <newren gmail com>
+
+ * src/window.c (meta_window_new_with_attrs): If a window is
+ launched without any kind of launch timestamp, grab the current
+ time and stash it away. When transients of that window are also
+ launched without a timestamp, we can use the stashed timestamp
+ from the parent. Fixes #488468.
+
2007-11-09 Federico Mena Quintero <federico@novell.com>
Merged from trunk:
diff --git a/src/window.c b/src/window.c
index 3c4e8ded..9e225d12 100644
--- a/src/window.c
+++ b/src/window.c
@@ -613,6 +613,33 @@ meta_window_new_with_attrs (MetaDisplay *display,
* based on startup notification
*/
meta_screen_apply_startup_properties (window->screen, window);
+
+ /* Try to get a "launch timestamp" for the window. If the window is
+ * a transient, we'd like to be able to get a last-usage timestamp
+ * from the parent window. If the window has no parent, there isn't
+ * much we can do...except record the current time so that any children
+ * can use this time as a fallback.
+ */
+ if (!window->net_wm_user_time_set) {
+ MetaWindow *parent = NULL;
+ if (window->xtransient_for)
+ parent = meta_display_lookup_x_window (window->display,
+ window->xtransient_for);
+
+ // First, maybe the app was launched with startup notification using an
+ // obsolete version of the spec; use that timestamp if it exists.
+ if (window->initial_timestamp_set)
+ // NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
+ // being recorded as a fallback for potential transients
+ window->net_wm_user_time = window->initial_timestamp;
+ else if (parent != NULL)
+ meta_window_set_user_time(window, parent->net_wm_user_time);
+ else
+ // NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
+ // being recorded as a fallback for potential transients
+ window->net_wm_user_time =
+ meta_display_get_current_time_roundtrip (window->display);
+ }
if (window->decorated)
meta_window_ensure_frame (window);