- ob_debug_type(OB_DEBUG_FOCUS,
- "Want to focus window 0x%x at time %u "
- "launched at %u (last user interaction time %u)",
- self->window, steal_time, launch_time,
- event_last_user_time);
+ ob_debug("Want to focus window 0x%x at time %u "
+ "launched at %u (last user interaction time %u) "
+ "request from %s, allow other desktop: %s",
+ self->window, steal_time, launch_time,
+ event_last_user_time,
+ (request_from_user ? "user" : "other"),
+ (allow_other_desktop ? "yes" : "no"));
+
+ /*
+ if no launch time is provided for an application, make one up.
+
+ if the window is related to other existing windows
+ and one of those windows was the last used
+ then we will give it a launch time equal to the last user time,
+ which will end up giving the window focus probably.
+ else
+ the window is related to other windows, but you are not working in
+ them?
+ seems suspicious, so we will give it a launch time of
+ NOW - STEAL_INTERVAL,
+ so it will be given focus only if we didn't use something else
+ during the steal interval.
+ else
+ the window is all on its own, so we can't judge it. give it a launch
+ time equal to the last user time, so it will probably take focus.
+
+ this way running things from a terminal will give them focus, but popups
+ without a launch time shouldn't steal focus so easily.
+ */