]> git.lizzy.rs Git - bspwm.git/commitdiff
Remove setting: cancel_birth_rotation
authorBastien Dejean <nihilhill@gmail.com>
Tue, 28 Aug 2018 18:08:19 +0000 (20:08 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 28 Aug 2018 18:08:19 +0000 (20:08 +0200)
Get rid of this concept once and for all. The layout that result from a
node removal needs to be predictable.

13 files changed:
contrib/bash_completion
contrib/fish_completion
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.asciidoc
src/messages.c
src/query.c
src/restore.c
src/settings.c
src/settings.h
src/tree.c
src/tree.h
src/types.h

index 8659788ddb58eff06d09a954ad81778a7ec5d43e..35c1f298352e3f25eb4f3f79288ae83096f26206 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
        local commands='node desktop monitor query rule wm subscribe config quit'
 
-       local settings='external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity directional_focus_tightness borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints cancel_birth_rotation remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
+       local settings='external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity directional_focus_tightness borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
 
        COMPREPLY=()
 
index ff99ff3d6c1e52ff352f9f7699560b61bad7394c..940ad07260632db148f2fec5ccb0d24234aea8f5 100644 (file)
@@ -11,4 +11,4 @@ function __fish_bspc_using_command
 end
 
 complete -f -c bspc -n '__fish_bspc_needs_command' -a 'node desktop monitor query rule wm subscribe config quit'
-complete -f -c bspc -n '__fish_bspc_using_command config' -a 'external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity directional_focus_tightness borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints cancel_birth_rotation remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
+complete -f -c bspc -n '__fish_bspc_using_command config' -a 'external_rules_command status_prefix normal_border_color active_border_color focused_border_color presel_feedback_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity directional_focus_tightness borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus swallow_first_click focus_follows_pointer pointer_follows_focus pointer_follows_monitor mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
index 711833b754d3c05e96a7cfeb74c1d9bed7f0a0ea..d66b9b2f87157b7b75ab3b8be354de48f97e6c3b 100644 (file)
@@ -315,7 +315,7 @@ _bspc() {
                        local -a look behaviour input
                        # Boolean settings are identified by index!
                        look=(borderless_monocle gapless_monocle {normal,active,focused}_border_color {top,right,bottom,left}_padding presel_feedback_color border_width window_gap)
-                       behaviour=(single_monocle mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints cancel_birth_rotation remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors status_prefix external_rules_command split_ratio initial_polarity directional_focus_tightness status_prefix)
+                       behaviour=(single_monocle mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors status_prefix external_rules_command split_ratio initial_polarity directional_focus_tightness status_prefix)
                        input=({swallow_first_click,focus_follows_pointer,pointer_follows_{focus,monitor}} click_to_focus pointer_motion_interval pointer_modifier pointer_action{1,2,3} )
                        if [[ "$CURRENT" == (2|3) ]];then
                                _arguments \
index 44d6a73877bd4b27fe0fc37a2f3b0a2d55c17d21..f545bd159dbdf3a5750c913f50817b16b2f1691f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2018
+.\"      Date: 08/28/2018
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.5-9-gb5d1d85
+.\"    Source: Bspwm 0.9.5-10-g336bc86
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "08/25/2018" "Bspwm 0\&.9\&.5\-9\-gb5d1d85" "Bspwm Manual"
+.TH "BSPWM" "1" "08/28/2018" "Bspwm 0\&.9\&.5\-10\-g336bc86" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1292,11 +1292,6 @@ Center pseudo tiled windows into their tiling rectangles\&. Defaults to
 Apply ICCCM window size hints\&.
 .RE
 .PP
-\fIcancel_birth_rotation\fR
-.RS 4
-When a node is unlinked from a tree, cancel the tree rotation that was applied during its insertion\&.
-.RE
-.PP
 \fIremove_disabled_monitors\fR
 .RS 4
 Consider disabled monitors as disconnected\&.
index c5404a666d8d5a23341789cd60c29cbfc5534020..70f1919054113f94e895db60ce3618f2db814183 100644 (file)
@@ -736,9 +736,6 @@ Global Settings
 'honor_size_hints'::
        Apply ICCCM window size hints.
 
-'cancel_birth_rotation'::
-       When a node is unlinked from a tree, cancel the tree rotation that was applied during its insertion.
-
 'remove_disabled_monitors'::
        Consider disabled monitors as disconnected.
 
index 004325577a86ae8c1a467c63429567c9ec3fbf5b..0ed08660a0849948bd4ec9e9de2cc24e13578316 100644 (file)
@@ -1652,7 +1652,6 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                SET_BOOL(ignore_ewmh_focus)
                SET_BOOL(center_pseudo_tiled)
                SET_BOOL(honor_size_hints)
-               SET_BOOL(cancel_birth_rotation)
 #undef SET_BOOL
 #define SET_MON_BOOL(s) \
        } else if (streq(#s, name)) { \
@@ -1771,7 +1770,6 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp)
        GET_BOOL(ignore_ewmh_focus)
        GET_BOOL(center_pseudo_tiled)
        GET_BOOL(honor_size_hints)
-       GET_BOOL(cancel_birth_rotation)
        GET_BOOL(remove_disabled_monitors)
        GET_BOOL(remove_unplugged_monitors)
        GET_BOOL(merge_overlapping_monitors)
index 3d99a17000248647d29093b433dace41cba12450..dfdee88689722713eecbbfa09b39cfacbe6faaf0 100644 (file)
@@ -117,7 +117,6 @@ void query_node(node_t *n, FILE *rsp)
                fprintf(rsp, "\"id\":%u,", n->id);
                fprintf(rsp, "\"splitType\":\"%s\",", SPLIT_TYPE_STR(n->split_type));
                fprintf(rsp, "\"splitRatio\":%lf,", n->split_ratio);
-               fprintf(rsp, "\"birthRotation\":%i,", n->birth_rotation);
                fprintf(rsp, "\"vacant\":%s,", BOOL_STR(n->vacant));
                fprintf(rsp, "\"hidden\":%s,", BOOL_STR(n->hidden));
                fprintf(rsp, "\"sticky\":%s,", BOOL_STR(n->sticky));
index 26c342ac085e1da10a68d2dc75fbee54c539c9c7..7f291f9bf1dc0550bbb10423d64a2905ded8c54c 100644 (file)
@@ -353,7 +353,6 @@ node_t *restore_node(jsmntok_t **t, char *json)
                                sscanf(json + (*t)->start, "%u", &n->id);
                        RESTORE_ANY(splitType, &n->split_type, parse_split_type)
                        RESTORE_DOUBLE(splitRatio, &n->split_ratio)
-                       RESTORE_INT(birthRotation, &n->birth_rotation)
                        RESTORE_BOOL(vacant, &n->vacant)
                        RESTORE_BOOL(hidden, &n->hidden)
                        RESTORE_BOOL(sticky, &n->sticky)
index eeea41fc55171de1d171d9266d857a544c15a753..f8390b8a2fdec1aad87db896dcf2c76a4b82ea6f 100644 (file)
@@ -81,7 +81,6 @@ void load_settings(void)
 
        center_pseudo_tiled = CENTER_PSEUDO_TILED;
        honor_size_hints = HONOR_SIZE_HINTS;
-       cancel_birth_rotation = CANCEL_BIRTH_ROTATION;
 
        remove_disabled_monitors = REMOVE_DISABLED_MONITORS;
        remove_unplugged_monitors = REMOVE_UNPLUGGED_MONITORS;
index c29a24a5fc16d6b3d47494389b55a2ef4c52d8b1..4c1564405c3156d02ab39d62e0ed99282a8bc30b 100644 (file)
@@ -57,7 +57,6 @@
 
 #define CENTER_PSEUDO_TILED         true
 #define HONOR_SIZE_HINTS            false
-#define CANCEL_BIRTH_ROTATION       false
 #define MAPPING_EVENTS_COUNT        1
 
 #define REMOVE_DISABLED_MONITORS    false
@@ -99,7 +98,6 @@ state_transition_t ignore_ewmh_fullscreen;
 
 bool center_pseudo_tiled;
 bool honor_size_hints;
-bool cancel_birth_rotation;
 
 bool remove_disabled_monitors;
 bool remove_unplugged_monitors;
index 0d645a162c6ea97e2aaaf0db056847c94eebe8d2..a33feedfa8c5e64348bd2c0e37dd84ac2b0c1977 100644 (file)
@@ -334,7 +334,6 @@ node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                        p = f->parent;
                }
                n->parent = c;
-               c->birth_rotation = f->birth_rotation;
                if (f->presel == NULL) {
                        if (p == NULL) {
                                if (initial_polarity == FIRST_CHILD) {
@@ -377,7 +376,6 @@ node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                                        rot = 270;
                                }
                                if (!n->vacant) {
-                                       n->birth_rotation = rot;
                                        rotate_tree(p, rot);
                                }
                        }
@@ -392,7 +390,6 @@ node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                        c->split_ratio = f->presel->split_ratio;
                        c->parent = p;
                        f->parent = c;
-                       f->birth_rotation = 0;
                        switch (f->presel->split_dir) {
                                case DIR_WEST:
                                        c->split_type = TYPE_VERTICAL;
@@ -677,7 +674,6 @@ node_t *make_node(uint32_t id)
        n->vacant = n->hidden = n->sticky = n->private = n->locked = n->marked = false;
        n->split_ratio = split_ratio;
        n->split_type = TYPE_VERTICAL;
-       n->birth_rotation = 0;
        n->constraints = (constraints_t) {MIN_WIDTH, MIN_HEIGHT};
        n->presel = NULL;
        n->client = NULL;
@@ -1117,24 +1113,6 @@ void rotate_tree_rec(node_t *n, int deg)
        rotate_tree_rec(n->second_child, deg);
 }
 
-void rotate_brother(node_t *n)
-{
-       rotate_tree(brother_tree(n), n->birth_rotation);
-}
-
-void unrotate_tree(node_t *n, int rot)
-{
-       if (rot == 0) {
-               return;
-       }
-       rotate_tree(n, 360 - rot);
-}
-
-void unrotate_brother(node_t *n)
-{
-       unrotate_tree(brother_tree(n), n->birth_rotation);
-}
-
 void flip_tree(node_t *n, flip_t flp)
 {
        if (n == NULL || is_leaf(n)) {
@@ -1208,10 +1186,6 @@ void unlink_node(monitor_t *m, desktop_t *d, node_t *n)
                node_t *b = brother_tree(n);
                node_t *g = p->parent;
 
-               if (!n->vacant && cancel_birth_rotation) {
-                       unrotate_tree(b, n->birth_rotation);
-               }
-
                b->parent = g;
 
                if (g != NULL) {
@@ -1224,8 +1198,6 @@ void unlink_node(monitor_t *m, desktop_t *d, node_t *n)
                        d->root = b;
                }
 
-               b->birth_rotation = p->birth_rotation;
-
                free(p);
                n->parent = NULL;
 
@@ -1322,8 +1294,6 @@ bool swap_nodes(monitor_t *m1, desktop_t *d1, node_t *n1, monitor_t *m2, desktop
        node_t *pn2 = n2->parent;
        bool n1_first_child = is_first_child(n1);
        bool n2_first_child = is_first_child(n2);
-       int br1 = n1->birth_rotation;
-       int br2 = n2->birth_rotation;
        bool n1_held_focus = is_descendant(d1->focus, n1);
        bool n2_held_focus = is_descendant(d2->focus, n2);
        node_t *last_d1_focus = d1->focus;
@@ -1347,8 +1317,6 @@ bool swap_nodes(monitor_t *m1, desktop_t *d1, node_t *n1, monitor_t *m2, desktop
 
        n1->parent = pn2;
        n2->parent = pn1;
-       n1->birth_rotation = br2;
-       n2->birth_rotation = br1;
 
        propagate_flags_upward(m2, d2, n1);
        propagate_flags_upward(m1, d1, n2);
index 8c82b24889a6feaa072a099f4ec923075a6c0c06..0609d52785ed3ca023908fbb433a4e03744ae1d1 100644 (file)
@@ -74,9 +74,6 @@ int tiled_count(node_t *n, bool include_receptacles);
 void find_by_area(area_peak_t ap, coordinates_t *ref, coordinates_t *dst, node_select_t *sel);
 void rotate_tree(node_t *n, int deg);
 void rotate_tree_rec(node_t *n, int deg);
-void rotate_brother(node_t *n);
-void unrotate_tree(node_t *n, int rot);
-void unrotate_brother(node_t *n);
 void flip_tree(node_t *n, flip_t flp);
 void equalize_tree(node_t *n);
 int balance_tree(node_t *n);
index fb8952d517528eccea70e3a7246f8fd02b5fdfe9..2b43a35d105cca3109c84dbe6977b5d0cc445722 100644 (file)
@@ -233,7 +233,6 @@ struct node_t {
        uint32_t id;
        split_type_t split_type;
        double split_ratio;
-       int birth_rotation;
        presel_t *presel;
        xcb_rectangle_t rectangle;
        constraints_t constraints;