]> git.lizzy.rs Git - bspwm.git/commitdiff
Remove setting: `focus_by_distance`
authorBastien Dejean <nihilhill@gmail.com>
Sat, 13 Jul 2013 20:23:13 +0000 (22:23 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Sat, 13 Jul 2013 20:23:13 +0000 (22:23 +0200)
The removal is motivated by the following example:

+-------+-------+
|       |       |
|       |   b   |
|       |       |
|       |_______|
|   a   |       |
|   *   |   c   |
|       |       |
|       |_______|
|       |       |
|       |   d   |
|       |       |
+-------+-------+

Bellow is a summary of the number of steps required to reach *b*, *c* and *d* with *a* as a starting point with the associated mean and variance:

focus_by_distance         steps           mean         variance
---------------------------------------------------------------
  false                   1, 2, 3           2            2/3
  true                    2, 1, 2          5/3           2/9

README.asciidoc
doc/bspwm.1
doc/bspwm.1.txt
examples/autostart
messages.c
settings.c
settings.h
tree.c
tree.h

index 56c6808d8eafcb51aa3169370fc0242090f862a0..e6b65d7b114bd82e2dad67038a42668735f2a3fe 100644 (file)
@@ -547,9 +547,6 @@ All the boolean settings are 'false' by default.
 'auto_cancel'::
     Interpret two consecutive identical *presel* messages as a *cancel* message.
 
-'focus_by_distance'::
-    Use window or leaf distance for focus movement.
-
 'history_aware_focus'::
     Give priority to the focus history when focusing nodes.
 
index e44a6d2742b8551d6eea482e02dd033615f7efa0..1cfadd89dcdd46a92be451340585b742df0f0910 100644 (file)
@@ -895,11 +895,6 @@ messages as a
 message\&.
 .RE
 .PP
-\fIfocus_by_distance\fR
-.RS 4
-Use window or leaf distance for focus movement\&.
-.RE
-.PP
 \fIhistory_aware_focus\fR
 .RS 4
 Give priority to the focus history when focusing nodes\&.
index 0902babed60de33cf43b2033a97a7c5b57f6a4f2..330f747097123f6517325898ca855a05d246b9cb 100644 (file)
@@ -545,9 +545,6 @@ All the boolean settings are 'false' by default.
 'auto_cancel'::
     Interpret two consecutive identical *presel* messages as a *cancel* message.
 
-'focus_by_distance'::
-    Use window or leaf distance for focus movement.
-
 'history_aware_focus'::
     Give priority to the focus history when focusing nodes.
 
index 67a57362b778d345e09def0f261cc47254a82023..17ec7eb70b2b538435bbb674d743072ae6bc532d 100755 (executable)
@@ -12,4 +12,3 @@ bspc config border_width        2
 bspc config window_gap          12
 bspc config borderless_monocle  true
 bspc config gapless_monocle     true
-bspc config focus_by_distance   true
index 334fc3ad89a1f5ebc2a371f3dbd9bfd602d00da3..ea19c6346b1f35005da5c949d786d6ec34112b00 100644 (file)
@@ -695,7 +695,6 @@ bool set_setting(char *name, char *value)
         SETBOOL(apply_shadow_property)
         SETBOOL(auto_alternate)
         SETBOOL(auto_cancel)
-        SETBOOL(focus_by_distance)
         SETBOOL(history_aware_focus)
 #undef SETBOOL
     } else if (streq("wm_name", name)) {
@@ -752,7 +751,6 @@ bool get_setting(char *name, char* rsp)
     GETBOOL(apply_shadow_property)
     GETBOOL(auto_alternate)
     GETBOOL(auto_cancel)
-    GETBOOL(focus_by_distance)
     GETBOOL(history_aware_focus)
 #undef GETBOOL
     else if (streq("wm_name", name))
index f9732937775ad3f6d37a90e007be123b97981b73..a7771f160340a35844ac16271a05643ee146243e 100644 (file)
@@ -68,6 +68,5 @@ void load_settings(void)
     apply_shadow_property = APPLY_SHADOW_PROPERTY;
     auto_alternate = AUTO_ALTERNATE;
     auto_cancel = AUTO_CANCEL;
-    focus_by_distance = FOCUS_BY_DISTANCE;
     history_aware_focus = HISTORY_AWARE_FOCUS;
 }
index 4f96ed141f56f96a83b8406fdfa3ca16061742dd..70998939a9416cb2309f636b33b4d356beb6faf0 100644 (file)
@@ -28,7 +28,6 @@
 #define APPLY_SHADOW_PROPERTY    false
 #define AUTO_ALTERNATE           false
 #define AUTO_CANCEL              false
-#define FOCUS_BY_DISTANCE        false
 #define HISTORY_AWARE_FOCUS      false
 
 char focused_border_color[MAXLEN];
@@ -61,7 +60,6 @@ bool adaptative_raise;
 bool apply_shadow_property;
 bool auto_alternate;
 bool auto_cancel;
-bool focus_by_distance;
 bool history_aware_focus;
 
 char wm_name[MAXLEN];
diff --git a/tree.c b/tree.c
index 16760b4e94ac0d01dab3701f7b66c6e366222f18..2b4e9a5508b96e9d9640724fb0d339385f51bcb2 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -174,33 +174,8 @@ node_t *nearest_neighbor(desktop_t *d, node_t *n, direction_t dir)
     node_t *nearest = NULL;
     if (history_aware_focus)
         nearest = nearest_from_history(d->history, n, dir);
-    if (nearest == NULL) {
-        if (focus_by_distance) {
-            nearest = nearest_from_distance(d, n, dir);
-        } else {
-            nearest = nearest_from_tree(n, dir);
-        }
-    }
-    return nearest;
-}
-
-node_t *nearest_from_tree(node_t *n, direction_t dir)
-{
-    if (n == NULL)
-        return NULL;
-
-    node_t *fence = find_fence(n, dir);
-
-    if (fence == NULL)
-        return NULL;
-
-    node_t *nearest = NULL;
-
-    if (dir == DIR_UP || dir == DIR_LEFT)
-        nearest = second_extrema(fence->first_child);
-    else if (dir == DIR_DOWN || dir == DIR_RIGHT)
-        nearest = first_extrema(fence->second_child);
-
+    if (nearest == NULL)
+        nearest = nearest_from_distance(d, n, dir);
     return nearest;
 }
 
diff --git a/tree.h b/tree.h
index 2f7d836b87450b6bb284d16abfd9a6c5fb3c2c5b..7e8ca4a406e3b2466eddc6382e099ede966022cd 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -14,7 +14,6 @@ void pseudo_focus(desktop_t *, node_t *);
 void update_current(void);
 node_t *find_fence(node_t *, direction_t);
 node_t *nearest_neighbor(desktop_t *, node_t *, direction_t);
-node_t *nearest_from_tree(node_t *, direction_t);
 node_t *nearest_from_distance(desktop_t *, node_t *, direction_t);
 node_t *nearest_from_history(focus_history_t *, node_t *, direction_t);
 node_t *find_biggest(desktop_t *);