]> git.sur5r.net Git - i3/i3/blobdiff - include/tree.h
Bugfix: Correctly revert focus to other floating windows when closing a floating...
[i3/i3] / include / tree.h
index 449f67efc34923ab36fed4b73cc9bde6d377ecb5..b483434fcdaad90891cbdf09d8fd5a4f8f34ade7 100644 (file)
@@ -18,13 +18,13 @@ extern struct all_cons_head all_cons;
  * assigning a workspace to each RandR output.
  *
  */
-void tree_init();
+void tree_init(xcb_get_geometry_reply_t *geometry);
 
 /**
  * Opens an empty container in the current container
  *
  */
-Con *tree_open_con(Con *con);
+Con *tree_open_con(Con *con, i3Window *window);
 
 /**
  * Splits (horizontally or vertically) the given container by creating a new
@@ -56,7 +56,7 @@ void tree_render();
  * Closes the current container using tree_close().
  *
  */
-void tree_close_con();
+void tree_close_con(kill_window_t kill_window);
 
 /**
  * Changes focus in the given way (next/previous) and given orientation
@@ -66,22 +66,39 @@ void tree_close_con();
 void tree_next(char way, orientation_t orientation);
 
 /**
- * Moves the current container in the given way (next/previous) and given
- * orientation (horizontal/vertical).
+ * Closes the given container including all children.
+ * Returns true if the container was killed or false if just WM_DELETE was sent
+ * and the window is expected to kill itself.
+ *
+ * The dont_kill_parent flag is specified when the function calls itself
+ * recursively while deleting a containers children.
+ *
+ * The force_set_focus flag is specified in the case of killing a floating
+ * window: tree_close() will be invoked for the CT_FLOATINGCON (the parent
+ * container) and focus should be set there.
  *
  */
-void tree_move(char way, orientation_t orientation);
+bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus);
 
 /**
- * Closes the given container including all children
+ * Loads tree from ~/.i3/_restart.json (used for in-place restarts).
  *
  */
-void tree_close(Con *con, bool kill_window);
+bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry);
 
 /**
- * Loads tree from ~/.i3/_restart.json (used for in-place restarts).
+ * tree_flatten() removes pairs of redundant split containers, e.g.:
+ *       [workspace, horizontal]
+ *   [v-split]           [child3]
+ *   [h-split]
+ * [child1] [child2]
+ * In this example, the v-split and h-split container are redundant.
+ * Such a situation can be created by moving containers in a direction which is
+ * not the orientation of their parent container. i3 needs to create a new
+ * split container then and if you move containers this way multiple times,
+ * redundant chains of split-containers can be the result.
  *
  */
-bool tree_restore();
+void tree_flatten(Con *child);
 
 #endif