]> git.lizzy.rs Git - bspwm.git/commitdiff
New setting: center_pseudo_tiled
authorBastien Dejean <nihilhill@gmail.com>
Thu, 15 Jan 2015 13:18:25 +0000 (14:18 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Thu, 15 Jan 2015 13:18:25 +0000 (14:18 +0100)
contrib/bash_completion
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.txt
messages.c
settings.c
settings.h
tree.c

index ba9c77ceea7d10ebeefee4918f9f956e9d675236..7599d488b619fb68189436a79b28028f1f6b3098 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
        local commands='window desktop monitor query pointer rule restore control config quit'
 
-       local settings='external_rules_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_focus pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus focus_by_distance ignore_ewmh_focus remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
+       local settings='external_rules_command status_prefix focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color focused_sticky_border_color normal_sticky_border_color focused_private_border_color active_private_border_color normal_private_border_color urgent_border_color border_width window_gap top_padding right_padding bottom_padding left_padding split_ratio initial_polarity borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_focus pointer_follows_monitor apply_floating_atom auto_alternate auto_cancel history_aware_focus focus_by_distance ignore_ewmh_focus center_pseudo_tiled remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors'
 
        COMPREPLY=()
 
index a00e50148dad41b1a4c2202526e8b35b318f5937..7e6bf741a6e7089b1e8eb82145401149d39f8628 100644 (file)
@@ -3,7 +3,7 @@
 _bspc() {
        local -a commands settings
        commands=('window' 'desktop' 'monitor' 'query' 'pointer' 'rule' 'restore' 'control' 'config' 'quit')
-       settings=('external_rules_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'initial_polarity' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'focus_by_distance' 'ignore_ewmh_focus' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
+       settings=('external_rules_command' 'status_prefix' 'focused_border_color' 'active_border_color' 'normal_border_color' 'presel_border_color' 'focused_locked_border_color' 'active_locked_border_color' 'normal_locked_border_color' 'focused_sticky_border_color' 'normal_sticky_border_color' 'focused_private_border_color' 'active_private_border_color' 'normal_private_border_color' 'urgent_border_color' 'border_width' 'window_gap' 'top_padding' 'right_padding' 'bottom_padding' 'left_padding' 'split_ratio' 'initial_polarity' 'borderless_monocle' 'gapless_monocle' 'focus_follows_pointer' 'pointer_follows_focus' 'pointer_follows_monitor' 'apply_floating_atom' 'auto_alternate' 'auto_cancel' 'history_aware_focus' 'focus_by_distance' 'ignore_ewmh_focus' 'center_pseudo_tiled' 'remove_disabled_monitors' 'remove_unplugged_monitors' 'merge_overlapping_monitors')
        if (( CURRENT == 2 )) ; then
                _values 'command' "$commands[@]"
        elif (( CURRENT == 3 )) ; then
index fe41e21fb31b53100367feb888fb44c3ff636dee..60955c2a79ab0300b214cd60bd3736c13dfe663b 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: 01/06/2015
+.\"      Date: 01/15/2015
 .\"    Manual: Bspwm Manual
 .\"    Source: Bspwm 0.8.9
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "01/06/2015" "Bspwm 0\&.8\&.9" "Bspwm Manual"
+.TH "BSPWM" "1" "01/15/2015" "Bspwm 0\&.8\&.9" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -965,9 +965,9 @@ Unknown command\&.
 .RE
 .SH "SETTINGS"
 .sp
-Colors are either X color names or \fI#RRGGBB\fR, booleans are \fItrue\fR or \fIfalse\fR\&.
+Colors are either \fI#RRGGBB\fR or X color names, booleans are \fItrue\fR, \fIon\fR, \fIfalse\fR or \fIoff\fR\&.
 .sp
-All the boolean settings are \fIfalse\fR by default\&.
+All the boolean settings are \fIfalse\fR by default unless stated otherwise\&.
 .SS "Global Settings"
 .PP
 \fIfocused_border_color\fR
@@ -1133,6 +1133,12 @@ atom of each window according to its floating state\&.
 Ignore EWMH focus requests coming from applications\&.
 .RE
 .PP
+\fIcenter_pseudo_tiled\fR
+.RS 4
+Center pseudo tiled windows into their tiling rectangles\&. Defaults to
+\fItrue\fR\&.
+.RE
+.PP
 \fIremove_disabled_monitors\fR
 .RS 4
 Consider disabled monitors as disconnected\&.
index 89b4d10ab03c36ad5cbd759cce981a65356e70ff..bed3768222cc403460cb9af333ba985064bf1f24 100644 (file)
@@ -594,9 +594,9 @@ If the server can't handle a message, *bspc* will return with one of the followi
 
 Settings
 --------
-Colors are either http://en.wikipedia.org/wiki/X11_color_names[X color names] or '#RRGGBB', booleans are 'true' or 'false'.
+Colors are either '#RRGGBB' or http://en.wikipedia.org/wiki/X11_color_names[X color names], booleans are 'true', 'on', 'false' or 'off'.
 
-All the boolean settings are 'false' by default.
+All the boolean settings are 'false' by default unless stated otherwise.
 
 Global Settings
 ~~~~~~~~~~~~~~~
@@ -688,6 +688,9 @@ Global Settings
 'ignore_ewmh_focus'::
        Ignore EWMH focus requests coming from applications.
 
+'center_pseudo_tiled'::
+       Center pseudo tiled windows into their tiling rectangles. Defaults to 'true'.
+
 'remove_disabled_monitors'::
        Consider disabled monitors as disconnected.
 
index c0f773a34449169e3c6d97be491701f62c7e52ee..e9bf052d28c2871b4532e1b8d197bed629738d8c 100644 (file)
@@ -1002,6 +1002,7 @@ int set_setting(coordinates_t loc, char *name, char *value)
                SETBOOL(history_aware_focus)
                SETBOOL(focus_by_distance)
                SETBOOL(ignore_ewmh_focus)
+               SETBOOL(center_pseudo_tiled)
 #undef SETBOOL
 #define SETMONBOOL(s) \
        } else if (streq(#s, name)) { \
@@ -1088,6 +1089,7 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
        GETBOOL(history_aware_focus)
        GETBOOL(focus_by_distance)
        GETBOOL(ignore_ewmh_focus)
+       GETBOOL(center_pseudo_tiled)
        GETBOOL(remove_disabled_monitors)
        GETBOOL(remove_unplugged_monitors)
        GETBOOL(merge_overlapping_monitors)
index 1d73146628a87378a4d6f8f5739d7cd2676e572b..e6ab7cca0de201501cfd69a71e31e2167325c8e2 100644 (file)
@@ -72,6 +72,7 @@ void load_settings(void)
        auto_cancel = AUTO_CANCEL;
        history_aware_focus = HISTORY_AWARE_FOCUS;
        ignore_ewmh_focus = IGNORE_EWMH_FOCUS;
+       center_pseudo_tiled = CENTER_PSEUDO_TILED;
        remove_disabled_monitors = REMOVE_DISABLED_MONITORS;
        remove_unplugged_monitors = REMOVE_UNPLUGGED_MONITORS;
        merge_overlapping_monitors = MERGE_OVERLAPPING_MONITORS;
index 41f2cfc112391877ac87a9d66ec5fac75e5d81fa..b6d9ed4f80c6fb3dd9973803cf80fe2bc97ba32a 100644 (file)
@@ -63,6 +63,7 @@
 #define AUTO_CANCEL                 false
 #define APPLY_FLOATING_ATOM         false
 #define IGNORE_EWMH_FOCUS           false
+#define CENTER_PSEUDO_TILED         true
 #define REMOVE_DISABLED_MONITORS    false
 #define REMOVE_UNPLUGGED_MONITORS   false
 #define MERGE_OVERLAPPING_MONITORS  false
@@ -101,6 +102,7 @@ bool auto_cancel;
 bool history_aware_focus;
 bool focus_by_distance;
 bool ignore_ewmh_focus;
+bool center_pseudo_tiled;
 bool remove_disabled_monitors;
 bool remove_unplugged_monitors;
 bool merge_overlapping_monitors;
diff --git a/tree.c b/tree.c
index 2d5b4abb12e9fa73da42259f64a5da65ca2fde1e..08e23ca8e1583e6e1126bdb554a4cd404dc1ee21 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -76,8 +76,13 @@ void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, x
                                if (n->client->pseudo_tiled) {
                                /* pseudo-tiled clients */
                                        r = n->client->floating_rectangle;
-                                       r.x = rect.x - bw + (rect.width - wg - r.width) / 2;
-                                       r.y = rect.y - bw + (rect.height - wg - r.height) / 2;
+                                       if (center_pseudo_tiled) {
+                                               r.x = rect.x - bw + (rect.width - wg - r.width) / 2;
+                                               r.y = rect.y - bw + (rect.height - wg - r.height) / 2;
+                                       } else {
+                                               r.x = rect.x;
+                                               r.y = rect.y;
+                                       }
                                } else {
                                        /* tiled clients */
                                        r = rect;