Index: gdk/x11/gdkwindow-x11.c
===================================================================
--- gdk/x11/gdkwindow-x11.c	(revision 17511)
+++ gdk/x11/gdkwindow-x11.c	(working copy)
@@ -610,6 +610,11 @@
 		   XA_WINDOW, 32, PropModeReplace,
 		   (guchar *) &GDK_DISPLAY_X11 (screen_x11->display)->leader_window, 1);
 
+  XChangeProperty (xdisplay, xid, 
+		   gdk_x11_get_xatom_by_name_for_display (screen_x11->display, "_NET_WM_USER_TIME_WINDOW"),
+		   XA_WINDOW, 32, PropModeReplace,
+		   (guchar *) &toplevel->focus_window, 1);
+
   if (!obj->focus_on_map)
     gdk_x11_window_set_user_time (window, 0);
   else if (GDK_DISPLAY_X11 (screen_x11->display)->user_time != 0)
@@ -4219,6 +4224,7 @@
   GdkDisplayX11 *display_x11;
   GdkToplevelX11 *toplevel;
   glong timestamp_long = (glong)timestamp;
+  Window xid;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -4229,7 +4235,13 @@
   display_x11 = GDK_DISPLAY_X11 (display);
   toplevel = _gdk_x11_window_get_toplevel (window);
 
-  XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
+  if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
+                                           gdk_atom_intern_static_string ("_NET_WM_USER_TIME_WINDOW")))
+    xid = toplevel->focus_window;
+  else
+    xid = GDK_WINDOW_XID (window);
+
+  XChangeProperty (GDK_DISPLAY_XDISPLAY (display), xid,
                    gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
                    XA_CARDINAL, 32, PropModeReplace,
                    (guchar *)&timestamp_long, 1);
