]> git.sur5r.net Git - i3/i3/blobdiff - src/move.c
Merge pull request #3376 from orestisf1993/floating-disable-scratchpad
[i3/i3] / src / move.c
index 72cf9d6190645ca9c19b58265f34922ebf26affe..32178e6b2890837d46fdf9044bd5f1b2aab239e0 100644 (file)
@@ -9,9 +9,6 @@
  */
 #include "all.h"
 
-typedef enum { BEFORE,
-               AFTER } position_t;
-
 /*
  * Returns the lowest container in the tree that has both a and b as descendants.
  *
@@ -65,7 +62,7 @@ static bool is_focused_descendant(Con *con, Con *ancestor) {
  * after 'target'.
  *
  */
-static void insert_con_into(Con *con, Con *target, position_t position) {
+void insert_con_into(Con *con, Con *target, position_t position) {
     Con *parent = target->parent;
     /* We need to preserve the old con->parent. While it might still be used to
      * insert the entry before/after it, we call the on_remove_child callback
@@ -256,13 +253,19 @@ void tree_move(Con *con, int direction) {
         return;
     }
 
-    if (con->parent->type == CT_WORKSPACE && con_num_children(con->parent) == 1) {
+    if (con->fullscreen_mode == CF_GLOBAL) {
+        DLOG("Not moving fullscreen global container\n");
+        return;
+    }
+
+    if ((con->fullscreen_mode == CF_OUTPUT) ||
+        (con->parent->type == CT_WORKSPACE && con_num_children(con->parent) == 1)) {
         /* This is the only con on this workspace */
         move_to_output_directed(con, direction);
         return;
     }
 
-    orientation_t o = (direction == D_LEFT || direction == D_RIGHT ? HORIZ : VERT);
+    orientation_t o = orientation_from_direction(direction);
 
     Con *same_orientation = con_parent_with_orientation(con, o);
     /* The do {} while is used to 'restart' at this point with a different
@@ -374,11 +377,6 @@ void tree_move(Con *con, int direction) {
     }
 
 end:
-    /* We need to call con_focus() to fix the focus stack "above" the container
-     * we just inserted the focused container into (otherwise, the parent
-     * container(s) would still point to the old container(s)). */
-    con_focus(con);
-
     /* force re-painting the indicators */
     FREE(con->deco_render_params);