From c5c34cca1c9b57424fa7ca686995126f627903ab Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 15 Oct 2010 15:06:16 -0400 Subject: 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. --- openbox/event.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'openbox/event.c') diff --git a/openbox/event.c b/openbox/event.c index a72f07b2..b0a53dba 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -273,7 +273,7 @@ static void event_set_curtime(XEvent *e) which can happen if the clock goes backwards, we erase the last specified user_time */ if (t && event_last_user_time && event_time_after(event_last_user_time, t)) - event_last_user_time = CurrentTime; + event_reset_user_time(); event_sourcetime = CurrentTime; event_curtime = t; @@ -2251,3 +2251,8 @@ void event_update_user_time(void) { event_last_user_time = event_time(); } + +void event_reset_user_time(void) +{ + event_last_user_time = CurrentTime; +} -- cgit v1.2.3