Index: src/display.c
===================================================================
RCS file: /cvs/gnome/metacity/src/display.c,v
retrieving revision 1.227
diff -p -u -r1.227 display.c
--- src/display.c	15 Sep 2004 15:46:25 -0000	1.227
+++ src/display.c	15 Sep 2004 22:16:56 -0000
@@ -1793,6 +1793,10 @@ event_callback (XEvent   *event,
       else if (meta_display_screen_for_root (display,
                                              event->xany.window) != NULL)
         {
+          MetaScreen * screen;
+          MetaWindow * mouse_window;
+          gboolean enter_notify_events_will_handle_this;
+
           meta_topic (META_DEBUG_FOCUS,
                       "Focus %s event received on root window 0x%lx "
                       "mode %s detail %s\n",
@@ -1803,8 +1807,20 @@ event_callback (XEvent   *event,
                       meta_event_mode_to_string (event->xfocus.mode),
                       meta_event_detail_to_string (event->xfocus.detail));
           
+          enter_notify_events_will_handle_this = FALSE;
+          screen = meta_display_screen_for_root (display, event->xany.window);
+          mouse_window = meta_screen_get_mouse_window (screen, NULL);
+          if (meta_prefs_get_focus_mode () != META_FOCUS_MODE_CLICK &&
+              mouse_window &&
+              mouse_window->type != META_WINDOW_DOCK &&
+              mouse_window->type != META_WINDOW_DESKTOP)
+            {
+              enter_notify_events_will_handle_this = TRUE;
+            }
+
           if (event->type == FocusIn &&
-              event->xfocus.detail == NotifyDetailNone)
+              event->xfocus.detail == NotifyDetailNone &&
+              !enter_notify_events_will_handle_this)
             {
               XEvent   property_event;
 
Index: src/workspace.c
===================================================================
RCS file: /cvs/gnome/metacity/src/workspace.c,v
retrieving revision 1.62
diff -p -u -r1.62 workspace.c
--- src/workspace.c	15 Sep 2004 16:53:20 -0000	1.62
+++ src/workspace.c	15 Sep 2004 22:16:56 -0000
@@ -803,9 +803,7 @@ meta_workspace_focus_default_window (Met
           window->type != META_WINDOW_DESKTOP)
         {
           meta_topic (META_DEBUG_FOCUS,
-                      "Focusing mouse window %s\n", window->desc);
-
-          meta_window_focus (window, meta_display_get_current_time (workspace->screen->display));
+                      "Not focusing mouse window %s because EnterNotify events should handle that\n", window->desc);
         }
       else if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_SLOPPY)
         meta_workspace_focus_mru_window (workspace, not_this_one);
