]> git.sur5r.net Git - i3/i3/commitdiff
Focus a newly managed container only if it doesn't use the globally active input...
authorIngo Bürk <admin@airblader.de>
Tue, 26 Apr 2016 07:09:07 +0000 (09:09 +0200)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Tue, 26 Apr 2016 07:09:07 +0000 (08:09 +0100)
fixes #1784

src/manage.c

index f868c85d4a9796c4edd8cd6d112dbf536ad8bed1..37d50e7bd22526dab63fdb9efc2132735c39e0f8 100644 (file)
@@ -602,9 +602,20 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
         xcb_discard_reply(conn, wm_user_time_cookie.sequence);
     }
 
+    if (set_focus) {
+        /* Even if the client doesn't want focus, we still need to focus the
+         * container to not break focus workflows. Our handling towards X will
+         * take care of not setting the input focus. However, one exception to
+         * this are clients using the globally active input model which we
+         * don't want to focus at all. */
+        if (nc->window->doesnt_accept_focus && !nc->window->needs_take_focus) {
+            set_focus = false;
+        }
+    }
+
     /* Defer setting focus after the 'new' event has been sent to ensure the
      * proper window event sequence. */
-    if (set_focus && !nc->window->doesnt_accept_focus && nc->mapped) {
+    if (set_focus && nc->mapped) {
         DLOG("Now setting focus.\n");
         con_focus(nc);
     }