]> git.lizzy.rs Git - bspwm.git/commitdiff
Remove setting: focus_by_distance
authorBastien Dejean <nihilhill@gmail.com>
Thu, 21 Apr 2016 08:45:05 +0000 (10:45 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Thu, 21 Apr 2016 08:45:05 +0000 (10:45 +0200)
Unfortunately nearest_from_tree is rather useless because it can't skip
vacant or receptacle nodes.

Therefore, *focus_by_distance* is now the default.

contrib/bash_completion
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.asciidoc
examples/bspwmrc
messages.c
settings.h
tree.c
tree.h

index c5fdcb6fccf4fcfb0eecbfa63a099594fa9d97a4..342c663595acc8cecfc4d3df563852e7a4dec482 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
        local commands='node desktop monitor query rule restore 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 borderless_monocle gapless_monocle single_monocle pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus focus_follows_pointer pointer_follows_focus pointer_follows_monitor history_aware_focus focus_by_distance ignore_ewmh_focus center_pseudo_tiled honor_size_hints 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 borderless_monocle gapless_monocle single_monocle pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus focus_follows_pointer pointer_follows_focus pointer_follows_monitor history_aware_focus ignore_ewmh_focus center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
 
        COMPREPLY=()
 
index 1723154dbddf5273cdfc8ce2cf586a29d2c9b3fb..96e38346e2af6bdfcc3b7f5360c3b2ade0969987 100644 (file)
@@ -3,7 +3,7 @@
 _bspc() {
        local -a commands settings
        commands=('node' 'desktop' 'monitor' 'query' 'rule' 'restore' 'wm' 'subscribe' 'config' 'quit')
-       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' 'borderless_monocle' 'gapless_monocle' 'single_monocle' 'pointer_modifier' 'pointer_action1' 'pointer_action2' 'pointer_action3' 'click_to_focus' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' 'history_aware_focus' 'focus_by_distance' 'ignore_ewmh_focus' 'center_pseudo_tiled' 'honor_size_hints' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
+       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' 'borderless_monocle' 'gapless_monocle' 'single_monocle' 'pointer_modifier' 'pointer_action1' 'pointer_action2' 'pointer_action3' 'click_to_focus' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' 'history_aware_focus' 'ignore_ewmh_focus' 'center_pseudo_tiled' 'honor_size_hints' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
        if (( CURRENT == 2 )) ; then
                _values 'command' "$commands[@]"
        elif (( CURRENT == 3 )) ; then
index 2dfe5bf93197e973e83bf59a1993fe1bb1f2faa4..ca1adfa08644ae18a935aa09ab524e18fd0c33bd 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 04/19/2016
+.\"      Date: 04/21/2016
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.1-39-ge70f826
+.\"    Source: Bspwm 0.9.1-45-g09e3d72
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "04/19/2016" "Bspwm 0\&.9\&.1\-39\-ge70f826" "Bspwm Manual"
+.TH "BSPWM" "1" "04/21/2016" "Bspwm 0\&.9\&.1\-45\-g09e3d72" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1022,11 +1022,6 @@ On which child should a new window be attached when adding a window on a single
 Give priority to the focus history when focusing nodes\&.
 .RE
 .PP
-\fIfocus_by_distance\fR
-.RS 4
-Base focusing on distances between windows\&.
-.RE
-.PP
 \fIborderless_monocle\fR
 .RS 4
 Remove borders of tiled windows for the
index 1913660c805e9e03d4e8220171dc77a576af6e6d..5633716d3581bd917026a4dc12c1b3ac12c96ae9 100644 (file)
@@ -603,9 +603,6 @@ Global Settings
 'history_aware_focus'::
        Give priority to the focus history when focusing nodes.
 
-'focus_by_distance'::
-       Base focusing on distances between windows.
-
 'borderless_monocle'::
        Remove borders of tiled windows for the *monocle* desktop layout.
 
index 006102d7eb61d1f6a0b39751676fcf9b897e748b..39e7f6400726aadd075ce6d156d593dacde3566e 100755 (executable)
@@ -10,7 +10,6 @@ bspc config window_gap          12
 bspc config split_ratio          0.52
 bspc config borderless_monocle   true
 bspc config gapless_monocle      true
-bspc config focus_by_distance    true
 bspc config history_aware_focus  true
 
 bspc rule -a Gimp desktop='^8' state=floating follow=on
index 963f32c769edc80d7683e114b113f7c0cc298398..ba781b244e51e11f38c331539f84c485405098d9 100644 (file)
@@ -1452,7 +1452,6 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                SET_BOOL(pointer_follows_focus)
                SET_BOOL(pointer_follows_monitor)
                SET_BOOL(history_aware_focus)
-               SET_BOOL(focus_by_distance)
                SET_BOOL(ignore_ewmh_focus)
                SET_BOOL(center_pseudo_tiled)
                SET_BOOL(honor_size_hints)
@@ -1557,7 +1556,6 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp)
        GET_BOOL(pointer_follows_focus)
        GET_BOOL(pointer_follows_monitor)
        GET_BOOL(history_aware_focus)
-       GET_BOOL(focus_by_distance)
        GET_BOOL(ignore_ewmh_focus)
        GET_BOOL(center_pseudo_tiled)
        GET_BOOL(honor_size_hints)
index 375d8da0b1ecc8e77de6caaa4f6f12c99c79471f..0fc5519221afb39e663c873df58405636543fee5 100644 (file)
@@ -34,7 +34,6 @@
 #define EXTERNAL_RULES_COMMAND  ""
 #define STATUS_PREFIX           "W"
 
-
 #define NORMAL_BORDER_COLOR           "#30302f"
 #define ACTIVE_BORDER_COLOR           "#474645"
 #define FOCUSED_BORDER_COLOR          "#817f7f"
@@ -46,7 +45,6 @@
 #define SPLIT_RATIO          0.5
 
 #define HISTORY_AWARE_FOCUS         false
-#define FOCUS_BY_DISTANCE           false
 #define BORDERLESS_MONOCLE          false
 #define GAPLESS_MONOCLE             false
 #define PADDINGLESS_MONOCLE         false
@@ -87,7 +85,6 @@ bool focus_follows_pointer;
 bool pointer_follows_focus;
 bool pointer_follows_monitor;
 bool history_aware_focus;
-bool focus_by_distance;
 bool ignore_ewmh_focus;
 bool center_pseudo_tiled;
 bool click_to_focus;
diff --git a/tree.c b/tree.c
index 339d402b8a7cbb987fa7043fc6da94159750eaa9..c46eb2e44dcf4af5c6741eaee54deda68660b86f 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -873,11 +873,7 @@ node_t *nearest_neighbor(monitor_t *m, desktop_t *d, node_t *n, direction_t dir,
                nearest = nearest_from_history(m, d, n, dir, sel);
        }
        if (nearest == NULL) {
-               if (focus_by_distance) {
-                       nearest = nearest_from_distance(m, d, n, dir, sel);
-               } else {
-                       nearest = nearest_from_tree(m, d, n, dir, sel);
-               }
+               nearest = nearest_from_distance(m, d, n, dir, sel);
        }
        return nearest;
 }
@@ -935,37 +931,6 @@ node_t *find_by_id_in(node_t *r, uint32_t id)
        }
 }
 
-node_t *nearest_from_tree(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel)
-{
-       if (n == NULL) {
-               return NULL;
-       }
-
-       node_t *fence = find_fence(n, dir);
-
-       if (fence == NULL) {
-               return NULL;
-       }
-
-       node_t *nearest = NULL;
-
-       if (dir == DIR_NORTH || dir == DIR_WEST) {
-               nearest = second_extrema(fence->first_child);
-       } else if (dir == DIR_SOUTH || dir == DIR_EAST) {
-               nearest = first_extrema(fence->second_child);
-       }
-
-       coordinates_t ref = {m, d, n};
-       coordinates_t loc = {m, d, nearest};
-
-       if (nearest != NULL && (nearest->vacant ||
-                               nearest->client == NULL || !node_matches(&loc, &ref, sel))) {
-               return NULL;
-       }
-
-       return nearest;
-}
-
 node_t *nearest_from_history(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel)
 {
        if (n == NULL || (n->client != NULL && !IS_TILED(n->client))) {
diff --git a/tree.h b/tree.h
index 8dff752e04139f0c45a2b0f692ceedc675604eb7..cd3fa8aa8e3ae82d0135c0fddd398f46325f9e1c 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -64,7 +64,6 @@ bool is_child(node_t *a, node_t *b);
 bool is_descendant(node_t *a, node_t *b);
 bool find_by_id(uint32_t id, coordinates_t *loc);
 node_t *find_by_id_in(node_t *r, uint32_t id);
-node_t *nearest_from_tree(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
 node_t *nearest_from_history(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
 node_t *nearest_from_distance(monitor_t *m, desktop_t *d, node_t *n, direction_t dir, node_select_t sel);
 void get_opposite(direction_t src, direction_t *dst);