]> git.sur5r.net Git - i3/i3/blobdiff - src/tree.c
Merge pull request #3368 from orestisf1993/render_root
[i3/i3] / src / tree.c
index b8bc732bca6625f8d27f2c9624cebfa2d73eebea..96766b6a4f9346e37682d44f03c45a3e84728441 100644 (file)
@@ -330,6 +330,13 @@ bool tree_close_internal(Con *con, kill_window_t kill_window, bool dont_kill_par
         DLOG("parent container killed\n");
     }
 
+    if (ws == con) {
+        DLOG("Closing a workspace container, updating EWMH atoms\n");
+        ewmh_update_number_of_desktops();
+        ewmh_update_desktop_names();
+        ewmh_update_wm_desktop();
+    }
+
     con_free(con);
 
     /* in the case of floating windows, we already focused another container
@@ -560,9 +567,16 @@ static bool _tree_next(Con *con, char way, orientation_t orientation, bool wrap)
         if (!workspace)
             return false;
 
-        Con *focus = con_descend_tiling_focused(workspace);
-        if (focus == workspace) {
-            focus = con_descend_focused(workspace);
+        /* Use descend_focused first to give higher priority to floating or
+         * tiling fullscreen containers. */
+        Con *focus = con_descend_focused(workspace);
+        if (focus->fullscreen_mode == CF_NONE) {
+            Con *focus_tiling = con_descend_tiling_focused(workspace);
+            /* If descend_tiling returned a workspace then focus is either a
+             * floating container or the same workspace. */
+            if (focus_tiling != workspace) {
+                focus = focus_tiling;
+            }
         }
 
         workspace_show(workspace);