GNOME Bugzilla – Bug 131785
CurrentTime (0) in meta_window_focus
Last modified: 2004-12-22 21:47:04 UTC
Metacity is still using CurrentTime, or 0, in some instances. The initial mapping focus is given with time = 0. Focus assigned by clicking a window list button is also given with time = 0, though that may be a libwnck error. I'm seeing this in CVS HEAD from Dec. 21, 2003. The changelog doesn't indicate any relevant changes since then. The attached program may be used for testing. It just maps a window and reports the time from WM_TAKE_FOCUS messages with g_message.
Created attachment 23477 [details] test program
You can get the initial mapping timestamp from the PropertyNotify when WM_STATE is first set. _NET_WM_USER_TIME doesn't work for this because it may be 0 or not set. The fix is not as simple as I thought it would be, so I may soon attach a big patch. The other part of this is a libwnck bug, which I'll report soon if it hasn't been reported already.
The patch in bug 152000 should remove several instances where meta_window_focus was getting a timestamp of CurrentTime being passed. There are probably some that remain, though.
Actually, I think this bug has been resolved. In particular, for first window mapping there's a meta_display_get_current_time_roundtrip() call in meta_window_show() that came from bug 152000. libwnck now includes timestamps in _NET_ACTIVE_WINDOW messages (came near the end of bug 118372; see also bug 135024). So, I'm going to mark as FIXED. (Also, although no longer relevant, note that the test program doesn't compile: "undefined reference to `_gdk_x11_display_is_root_window'". _gdk_x11_display_is_root_window is a symbol in gdkprivate-x11.h, and that header file isn't installed for apps to include)