]> git.lizzy.rs Git - bspwm.git/commitdiff
Remove message: 'magnetise'
authorBastien Dejean <nihilhill@gmail.com>
Sun, 4 Nov 2012 13:16:30 +0000 (14:16 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 4 Nov 2012 13:16:30 +0000 (14:16 +0100)
README.md
bspwm.1
messages.c
messages.h
tree.c
tree.h

index 13527a6477a209c11ab991e0df5f467ab2b2b8c6..5deb0626ca4748c0be0d81a5ad478bd389107aab 100644 (file)
--- a/README.md
+++ b/README.md
@@ -182,9 +182,6 @@ The following messages are handled:
     rotate clockwise|counter_clockwise|full_cycle
         Rotate the tree of the current desktop.
 
-    magnetise top_left|top_right|bottom_left|bottom_right
-        Move all the fences toward the given corner.
-
     rule PATTERN floating
         Make a new rule that will float the windows whose class name or instance name equals PATTERN.
 
diff --git a/bspwm.1 b/bspwm.1
index 39a74110395758b2cc518c381d0e5d65a2e4605c..a4bf1ce34aeb1c8e0dbaed1b7984768fd89d0b74 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -211,9 +211,6 @@ Cycle the layout of the current desktop.
 .BI rotate " clockwise|counter_clockwise|full_cycle"
 Rotate the tree of the current desktop.
 .TP
-.BI magnetise " top_left|top_right|bottom_left|bottom_right"
-Move all the fences toward the given corner.
-.TP
 .BI rule " PATTERN floating "
 Make a new rule that will float the windows whose class name or instance name equals PATTERN.
 .TP
index b13fe1d0175a78e98b574fb577256e17378ba3be..ed5e8bb013141c0fc0977a6bbb07b671779c7be7 100644 (file)
@@ -50,14 +50,6 @@ void process_message(char *msg, char *rsp)
         return;
     } else if (strcmp(cmd, "kill") == 0) {
         window_kill(mon->desk, mon->desk->focus);
-    } else if (strcmp(cmd, "magnetise") == 0) {
-        char *cor = strtok(NULL, TOKEN_SEP);
-        if (cor != NULL) {
-            corner_t c;
-            if (parse_corner(cor, &c)) {
-                magnetise_tree(mon->desk->root, c);
-            }
-        }
     } else if (strcmp(cmd, "rotate") == 0) {
         char *deg = strtok(NULL, TOKEN_SEP);
         if (deg != NULL) {
@@ -578,24 +570,6 @@ bool parse_list_option(char *s, list_option_t *o)
     return false;
 }
 
-bool parse_corner(char *s, corner_t *c)
-{
-    if (strcmp(s, "top_left") == 0) {
-        *c = TOP_LEFT;
-        return true;
-    } else if (strcmp(s, "top_right") == 0) {
-        *c = TOP_RIGHT;
-        return true;
-    } else if (strcmp(s, "bottom_left") == 0) {
-        *c = BOTTOM_LEFT;
-        return true;
-    } else if (strcmp(s, "bottom_right") == 0) {
-        *c = BOTTOM_RIGHT;
-        return true;
-    }
-    return false;
-}
-
 bool parse_rotate(char *s, rotate_t *r)
 {
     if (strcmp(s, "clockwise") == 0) {
index aef82f2506396f55ac928628ff39f88cca63622f..90f0739c86ef56fff55f8b1a01ddd58097702f95 100644 (file)
@@ -15,7 +15,6 @@ bool parse_circulate_direction(char *, circulate_dir_t *);
 bool parse_list_option(char *, list_option_t *);
 bool parse_skip_client(char *, skip_client_t *);
 bool parse_skip_desktop(char *, skip_desktop_t *);
-bool parse_corner(char *, corner_t *);
 bool parse_rotate(char *, rotate_t *);
 bool parse_fence_move(char *, fence_move_t *);
 bool parse_modifier_mask(char *, unsigned int *);
diff --git a/tree.c b/tree.c
index 0b7bba54b0ebe6bb9c478de21a7d9401e178c121..1f1d1320182b4e6c7dfba0e5cd90a5c8e6178a2d 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -166,34 +166,6 @@ void rotate_tree(node_t *n, rotate_t rot)
     rotate_tree(n->second_child, rot);
 }
 
-void magnetise_tree(node_t *n, corner_t corner)
-{
-    if (n == NULL || is_leaf(n))
-        return;
-
-    PUTS("magnetise tree");
-
-    switch (n->split_type) {
-        case TYPE_HORIZONTAL:
-            if (corner == TOP_LEFT || corner == TOP_RIGHT)
-                change_split_ratio(n, CHANGE_DECREASE);
-            else
-                change_split_ratio(n, CHANGE_INCREASE);
-            break;
-        case TYPE_VERTICAL:
-            if (corner == TOP_LEFT || corner == BOTTOM_LEFT)
-                change_split_ratio(n, CHANGE_DECREASE);
-            else
-                change_split_ratio(n, CHANGE_INCREASE);
-            break;
-        default:
-            break;
-    }
-
-    magnetise_tree(n->first_child, corner);
-    magnetise_tree(n->second_child, corner);
-}
-
 void dump_tree(desktop_t *d, node_t *n, char *rsp, unsigned int depth)
 {
     if (n == NULL)
diff --git a/tree.h b/tree.h
index 5d1ca3d4520f3799a2cf44eb0d8c70fc16b24e60..9da8bee70dc7345f9c50802bcf7fb1b43b37862e 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -18,7 +18,6 @@ node_t *find_fence(node_t *, direction_t);
 node_t *find_neighbor(node_t *, direction_t);
 void move_fence(node_t *, direction_t, fence_move_t);
 void rotate_tree(node_t *, rotate_t);
-void magnetise_tree(node_t *, corner_t);
 void arrange(monitor_t *, desktop_t *);
 void apply_layout(monitor_t *, desktop_t *, node_t *, xcb_rectangle_t, xcb_rectangle_t);
 void insert_node(monitor_t *, desktop_t *, node_t *);