Index: src/display.c
===================================================================
RCS file: /cvs/gnome/metacity/src/display.c,v
retrieving revision 1.217
diff -p -u -r1.217 display.c
--- src/display.c	24 Jun 2004 15:47:04 -0000	1.217
+++ src/display.c	24 Jun 2004 21:04:27 -0000
@@ -1937,7 +1937,10 @@ event_callback (XEvent   *event,
                                                         space);
 
                   if (workspace)
-                    meta_workspace_activate (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/workspace.c
===================================================================
RCS file: /cvs/gnome/metacity/src/workspace.c,v
retrieving revision 1.57
diff -p -u -r1.57 workspace.c
--- src/workspace.c	24 Jun 2004 20:02:46 -0000	1.57
+++ src/workspace.c	24 Jun 2004 21:04:28 -0000
@@ -787,7 +787,9 @@ meta_workspace_focus_default_window (Met
     {
       MetaWindow * window;
       window = meta_screen_get_mouse_window (workspace->screen, not_this_one);
-      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);
@@ -817,7 +819,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;
