]> git.sur5r.net Git - i3/i3/commitdiff
Don't put new floating windows on top unless they're focused
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>
Tue, 27 Dec 2016 18:00:09 +0000 (19:00 +0100)
committerOrestis Floros <orestisf1993@gmail.com>
Fri, 22 Sep 2017 18:45:28 +0000 (21:45 +0300)
src/floating.c

index f29943393c208c60913449fedbfe04036ba5fb2d..f0499e60a2d7020ed5701d124fe76417b0fb5c4e 100644 (file)
@@ -196,7 +196,11 @@ void floating_enable(Con *con, bool automatic) {
     /* We insert nc already, even though its rect is not yet calculated. This
      * is necessary because otherwise the workspace might be empty (and get
      * closed in tree_close_internal()) even though it’s not. */
-    TAILQ_INSERT_TAIL(&(ws->floating_head), nc, floating_windows);
+    if (set_focus) {
+        TAILQ_INSERT_TAIL(&(ws->floating_head), nc, floating_windows);
+    } else {
+        TAILQ_INSERT_HEAD(&(ws->floating_head), nc, floating_windows);
+    }
     TAILQ_INSERT_TAIL(&(ws->focus_head), nc, focused);
 
     /* check if the parent container is empty and close it if so */