]> Dogcows Code - chaz/openbox/commitdiff
dont trust the _NET_ACTIVE_WINDOW timestamp. (fixes bug #4519)
authorDana Jansens <danakj@orodu.net>
Mon, 15 Feb 2010 17:33:33 +0000 (12:33 -0500)
committerDana Jansens <danakj@orodu.net>
Mon, 15 Feb 2010 18:48:04 +0000 (13:48 -0500)
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.

openbox/client.c
openbox/event.c

index 968a4585a978063318f34b0515c81eaeacb240e8..08ce6f375322d4257e2eaa77d91f3049b7bafd0f 100644 (file)
@@ -722,7 +722,7 @@ static gboolean client_can_steal_focus(ObClient *self, Time steal_time,
 
     /* 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);
index f466234bc2e25b235214ed8c63f14cc13c7472c3..14aa696bb119689bca9f110947b1c13fe857b682 100644 (file)
@@ -1357,11 +1357,23 @@ static void event_handle_client(ObClient *client, XEvent *e)
                        (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 "
This page took 0.030381 seconds and 4 git commands to generate.