]> git.sur5r.net Git - i3/i3/blobdiff - src/restore_layout.c
Merge pull request #1638 from hwangcc23/fix-1489
[i3/i3] / src / restore_layout.c
index 11590a33b1969a8d67656fea477d4cbb718a624f..f56372a690ac5427e140a05e2747fccc813234d1 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * restore_layout.c: Everything for restored containers that is not pure state
  *                   parsing (which can be found in load_layout.c).
@@ -180,7 +180,9 @@ static void update_placeholder_contents(placeholder_state *state) {
 
 static void open_placeholder_window(Con *con) {
     if (con_is_leaf(con) &&
-        (con->window == NULL || con->window->id == XCB_NONE)) {
+        (con->window == NULL || con->window->id == XCB_NONE) &&
+        !TAILQ_EMPTY(&(con->swallow_head)) &&
+        con->type == CT_CON) {
         xcb_window_t placeholder = create_window(
             restore_conn,
             con->rect,
@@ -194,6 +196,11 @@ static void open_placeholder_window(Con *con) {
                 config.client.placeholder.background,
                 XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY,
             });
+        /* Make i3 not focus this window. */
+        xcb_icccm_wm_hints_t hints;
+        xcb_icccm_wm_hints_set_none(&hints);
+        xcb_icccm_wm_hints_set_input(&hints, 0);
+        xcb_icccm_set_wm_hints(restore_conn, placeholder, &hints);
         /* Set the same name as was stored in the layout file. While perhaps
          * slightly confusing in the first instant, this brings additional
          * clarity to which placeholder is waiting for which actual window. */
@@ -219,7 +226,7 @@ static void open_placeholder_window(Con *con) {
         Match *temp_id = smalloc(sizeof(Match));
         match_init(temp_id);
         temp_id->id = placeholder;
-        TAILQ_INSERT_TAIL(&(con->swallow_head), temp_id, matches);
+        TAILQ_INSERT_HEAD(&(con->swallow_head), temp_id, matches);
     }
 
     Con *child;