? simple-focus.patch
? too-many-things.patch
Index: src/display.c
===================================================================
RCS file: /cvs/gnome/metacity/src/display.c,v
retrieving revision 1.216
diff -p -u -r1.216 display.c
--- src/display.c	19 Jun 2004 00:45:24 -0000	1.216
+++ src/display.c	23 Jun 2004 23:44:55 -0000
@@ -1924,8 +1924,10 @@ event_callback (XEvent   *event,
                     meta_screen_get_workspace_by_index (screen,
                                                         space);
 
-                  if (workspace)
+                  if (workspace) {
                     meta_workspace_activate (workspace);
+                    meta_workspace_focus_default_window (workspace, NULL);
+                  }
                   else
                     meta_verbose ("Don't know about workspace %d\n", space);
                 }
Index: src/screen.c
===================================================================
RCS file: /cvs/gnome/metacity/src/screen.c,v
retrieving revision 1.123
diff -p -u -r1.123 screen.c
--- src/screen.c	21 Jan 2004 17:33:56 -0000	1.123
+++ src/screen.c	23 Jun 2004 23:44:59 -0000
@@ -1256,8 +1256,9 @@ meta_screen_focus_mouse_window (MetaScre
                                                          root_x_return,
                                                          root_y_return);
 
-  /* FIXME I'm a loser on the CurrentTime front */
-  if (window)
+  if (window                           &&
+      window->type != META_WINDOW_DOCK &&
+      window->type != META_WINDOW_DESKTOP)
     {
       meta_topic (META_DEBUG_FOCUS,
                   "Focusing mouse window %s\n", window->desc);
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.328
diff -p -u -r1.328 window.c
--- src/window.c	21 Jun 2004 16:47:27 -0000	1.328
+++ src/window.c	23 Jun 2004 23:45:09 -0000
@@ -1808,14 +1808,21 @@ meta_window_minimize (MetaWindow  *windo
 {
   if (!window->minimized)
     {
+      MetaWindow *focus_window = window->display->focus_window;
+      
       window->minimized = TRUE;
       meta_window_queue_calc_showing (window);
 
       meta_window_foreach_transient (window,
                                      queue_calc_showing_func,
                                      NULL);
-      
-      if (window->has_focus)
+
+      /* FIXME: Should this include other types than docks?  What if the current
+       * window wasn't the one that had focus just before the dock.  I'm a
+       * little uneasy with this... but it is better than the current behavior.
+       */
+      if (window->has_focus ||
+          focus_window->type == META_WINDOW_DOCK)
         {
           meta_topic (META_DEBUG_FOCUS,
                       "Focusing top window due to minimization of focus window %s\n",
Index: src/workspace.c
===================================================================
RCS file: /cvs/gnome/metacity/src/workspace.c,v
retrieving revision 1.56
diff -p -u -r1.56 workspace.c
--- src/workspace.c	28 Feb 2004 02:53:55 -0000	1.56
+++ src/workspace.c	23 Jun 2004 23:45:11 -0000
@@ -803,7 +803,11 @@ meta_workspace_focus_mru_window (MetaWor
 
   while (tmp)
     {
-      if (((MetaWindow*) tmp->data) != not_this_one)
+      MetaWindow* tmp_window;
+      tmp_window = ((MetaWindow*) tmp->data);
+      if (tmp_window != not_this_one           &&
+          tmp_window->type != META_WINDOW_DOCK &&
+          tmp_window->type != META_WINDOW_DESKTOP)
         {
           window = tmp->data;
 	  break;
