? gdk/gdkpixbuf-render.loT
Index: gdk/x11/gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.205.2.3
diff -p -u -r1.205.2.3 gdkwindow-x11.c
--- gdk/x11/gdkwindow-x11.c	31 Jul 2004 04:44:43 -0000	1.205.2.3
+++ gdk/x11/gdkwindow-x11.c	20 Aug 2004 20:38:19 -0000
@@ -105,6 +105,14 @@ static gpointer parent_class = NULL;
   (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
    GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
 
+/* Return whether time1 is considered later than time2 as far as xserver
+ * time is concerned.  Accounts for wraparound.
+ */
+#define XSERVER_TIME_IS_LATER(time1, time2)                        \
+  ( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) ||  \
+    (( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 ))     \
+  )
+
 GType
 gdk_window_impl_x11_get_type (void)
 {
@@ -1194,6 +1202,9 @@ show_window_internal (GdkWindow *window,
   if (!private->destroyed)
     {
       GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+      GdkDisplay *display = gdk_drawable_get_display (window);
+      GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
+      GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
       Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
       Window xwindow = GDK_WINDOW_XID (window);
       
@@ -1211,6 +1222,13 @@ show_window_internal (GdkWindow *window,
       
       g_assert (GDK_WINDOW_IS_MAPPED (window));
 
+      if (toplevel &&
+          toplevel->user_time != 0 &&
+          XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
+        {
+          _gdk_x11_window_set_user_time (window, display_x11->user_time);
+        }
+
       if (impl->position_info.mapped)
         XMapWindow (xdisplay, xwindow);
     }
@@ -3367,6 +3385,8 @@ _gdk_x11_window_set_user_time (GdkWindow
 
   if (timestamp_long != GDK_CURRENT_TIME)
     display_x11->user_time = timestamp_long;
+
+  _gdk_x11_window_get_toplevel (window)->user_time = timestamp;
 }
 
 /**
Index: gdk/x11/gdkwindow-x11.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.h,v
retrieving revision 1.11
diff -p -u -r1.11 gdkwindow-x11.h
--- gdk/x11/gdkwindow-x11.h	18 Apr 2004 14:33:07 -0000	1.11
+++ gdk/x11/gdkwindow-x11.h	20 Aug 2004 20:38:19 -0000
@@ -114,6 +114,9 @@ struct _GdkToplevelX11
   GdkPixmap *icon_window;
   GdkWindow *group_leader;
 
+  /* Time of most recent user interaction. */
+  guint32 user_time;
+
   /* We use an extra X window for toplevel windows that we XSetInputFocus()
    * to in order to avoid getting keyboard events redirected to subwindows
    * that might not even be part of this app
