all repos — openbox @ 343ca097f7321983e62cac14791d62e1331d8d87

openbox fork - make it a bit more like ryudo

dont trust the _NET_ACTIVE_WINDOW timestamp. (fixes bug #4519)

if we decide to focus the window, do not use their provided timestamp.
chromium gives a very old timestamp, which means we think we're focusing the
window but it never actually gets focus, leading to inconsistent behaviour by
openbox.  use the timestamp for making decisions about passing focus if you
want (we dont right now), but not for the XSetInputFocus call.
Dana Jansens danakj@orodu.net
commit

343ca097f7321983e62cac14791d62e1331d8d87

parent

f011ce4c994830079a72bfe522ea0c0ff1185ffd

2 files changed, 14 insertions(+), 2 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -722,7 +722,7 @@ client_search_focus_group_full(self) != NULL));

/* This is focus stealing prevention */ ob_debug_type(OB_DEBUG_FOCUS, - "Want to focus new window 0x%x at time %u " + "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);
M openbox/event.copenbox/event.c

@@ -1357,11 +1357,23 @@ (e->xclient.data.l[0] == 1 ? "application" :

(e->xclient.data.l[0] == 2 ? "user" : "INVALID")))); /* XXX make use of data.l[2] !? */ if (e->xclient.data.l[0] == 1 || e->xclient.data.l[0] == 2) { - event_curtime = e->xclient.data.l[1]; + /* we can not trust the timestamp from applications. + e.g. chromium passes a very old timestamp. openbox thinks + the window will get focus and calls XSetInputFocus with the + (old) timestamp, which doesn't end up moving focus at all. + but the window is raised, not hilited, etc, as if it was + really going to get focus. + + so do not use this timestamp in event_curtime, as this would + be used in XSetInputFocus. + */ + /*event_curtime = e->xclient.data.l[1];*/ if (e->xclient.data.l[1] == 0) ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is" " missing a timestamp", client->title); + + event_curtime = event_get_server_time(); } else ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is "