Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/metacity/ChangeLog,v
retrieving revision 1.835
diff -p -u -r1.835 ChangeLog
--- ChangeLog	31 Jul 2004 19:56:09 -0000	1.835
+++ ChangeLog	31 Jul 2004 21:24:08 -0000
@@ -1,5 +1,18 @@
 2004-07-31  Rob Adams  <readams@readams.net>
 
+	Fix bug that caused windows to not be focused on unminimizing
+	because of user time support.
+	
+	* src/window.c (meta_window_new_with_attrs): initialize
+	focus_despite_user_time bit
+	(window_takes_focus_on_map): focus if focus_despite_user_time
+	despite user time, interestingly enough
+	(meta_window_show): reset focus_despite_user_time after showing
+
+	* src/window.h (_MetaWindow): add focus_despite_user_time bit
+
+2004-07-31  Rob Adams  <readams@readams.net>
+
 	Fix some support for EWMH hints, and fix USER_TIME support to
 	include the DEMANDS_ATTENTION hint.  Also includes some code for
 	implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.332
diff -p -u -r1.332 window.c
--- src/window.c	31 Jul 2004 19:56:10 -0000	1.332
+++ src/window.c	31 Jul 2004 21:24:30 -0000
@@ -456,6 +456,7 @@ meta_window_new_with_attrs (MetaDisplay 
   window->initial_workspace_set = FALSE;
   window->initial_timestamp_set = FALSE;
   window->net_wm_user_time_set = FALSE;
+  window->focus_despite_user_time = FALSE;
   window->calc_placement = FALSE;
   window->shaken_loose = FALSE;
   window->have_focus_click_grab = FALSE;
@@ -1618,6 +1619,8 @@ window_takes_focus_on_map (MetaWindow *w
     case META_WINDOW_NORMAL:
     case META_WINDOW_DIALOG:
     case META_WINDOW_MODAL_DIALOG:
+      if (window->focus_despite_user_time)
+	return TRUE;
 
       meta_topic (META_DEBUG_STARTUP,
                   "COMPARISON:\n"
@@ -1715,6 +1718,8 @@ meta_window_show (MetaWindow *window)
     meta_window_stack_just_below (window,
                                   window->display->focus_window);
 
+  window->focus_despite_user_time = FALSE;
+ 
   if (!window->placed)
     {
       /* We have to recalc the placement here since other windows may
@@ -1929,6 +1934,8 @@ meta_window_unminimize (MetaWindow  *win
   if (window->minimized)
     {
       window->minimized = FALSE;
+      window->focus_despite_user_time = TRUE;
+      
       meta_window_queue_calc_showing (window);
 
       meta_window_foreach_transient (window,
Index: src/window.h
===================================================================
RCS file: /cvs/gnome/metacity/src/window.h,v
retrieving revision 1.104
diff -p -u -r1.104 window.h
--- src/window.h	31 Jul 2004 19:56:10 -0000	1.104
+++ src/window.h	31 Jul 2004 21:24:31 -0000
@@ -147,6 +147,7 @@ struct _MetaWindow
   
   /* whether net_wm_user_time has been set yet */
   guint net_wm_user_time_set : 1;
+  guint focus_despite_user_time : 1;
   
   /* These are the flags from WM_PROTOCOLS */
   guint take_focus : 1;
