basically you need to figure out who is sending a _NET_ACTIVE_WINDOW request (e.g. done by gtk_window_present, gtk_window_present_with_time, wnck_window_activate) with a timestamp of 0 (also known as CurrentTime, or GDK_CURRENT_TIME). Then that app needs to be fixed.
Though it sounds like more may be going on, I don't know why this would result in the infinite loop. Unless it's some app "fighting" the WM by setting focus in response to focus changing.
Narrowing it down to only in mouse focus mode, only when running a devil's pie, only when running window list applet, that type of thing might be helpful. See if you can reproduce in failsafe session with only metacity+terminal running.
basically you need to figure out who is sending a _NET_ACTIVE_WINDOW request (e.g. done by gtk_window_present, gtk_window_ present_ with_time, wnck_window_ activate) with a timestamp of 0 (also known as CurrentTime, or GDK_CURRENT_TIME). Then that app needs to be fixed.
Though it sounds like more may be going on, I don't know why this would result in the infinite loop. Unless it's some app "fighting" the WM by setting focus in response to focus changing.
Narrowing it down to only in mouse focus mode, only when running a devil's pie, only when running window list applet, that type of thing might be helpful. See if you can reproduce in failsafe session with only metacity+terminal running.