Fixes #872.
_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 top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme 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'
+ 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 top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme removal_adjustment 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=()
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 top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme 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'
+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 top_monocle_padding right_monocle_padding bottom_monocle_padding left_monocle_padding split_ratio automatic_scheme removal_adjustment 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'
look_bool=(borderless_monocle gapless_monocle)
look=({normal,active,focused}_border_color {top,right,bottom,left}_padding {top,right,bottom,left}_monocle_padding presel_feedback_color border_width window_gap)
behaviour_bool=(single_monocle ignore_ewmh_focus center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors)
- behaviour=(mapping_events_count ignore_ewmh_fullscreen external_rules_command split_ratio automatic_scheme initial_polarity directional_focus_tightness status_prefix)
+ behaviour=(mapping_events_count ignore_ewmh_fullscreen external_rules_command split_ratio automatic_scheme removal_adjustment initial_polarity directional_focus_tightness status_prefix)
input_bool=(swallow_first_click focus_follows_pointer pointer_follows_{focus,monitor})
input=(click_to_focus pointer_motion_interval pointer_modifier pointer_action{1,2,3})
if [[ "$CURRENT" == (2|3) ]];then
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 09/29/2018
+.\" Date: 11/14/2018
.\" Manual: Bspwm Manual
-.\" Source: Bspwm 0.9.5-17-g8573b26
+.\" Source: Bspwm 0.9.5-20-gdb27b84
.\" Language: English
.\"
-.TH "BSPWM" "1" "09/29/2018" "Bspwm 0\&.9\&.5\-17\-g8573b26" "Bspwm Manual"
+.TH "BSPWM" "1" "11/14/2018" "Bspwm 0\&.9\&.5\-20\-gdb27b84" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fBspiral\fR\&.
.RE
.PP
+\fIremoval_adjustment\fR
+.RS 4
+The adjustment applied on the split types of a tree, after removing one of its nodes\&. Accept the following values:
+\fBlongest_side\fR,
+\fBnone\fR\&.
+.RE
+.PP
\fIinitial_polarity\fR
.RS 4
On which child should a new window be attached when adding a window on a single window tree in automatic mode\&. Accept the following values:
'automatic_scheme'::
The insertion scheme used when the insertion point is in automatic mode. Accept the following values: *longest_side*, *spiral*.
+'removal_adjustment'::
+ The adjustment applied on the split types of a tree, after removing one of its nodes. Accept the following values: *longest_side*, *none*.
+
'initial_polarity'::
On which child should a new window be attached when adding a window on a single window tree in automatic mode. Accept the following values: *first_child*, *second_child*.
subscribe_head = subscribe_tail = NULL;
pending_rule_head = pending_rule_tail = NULL;
auto_raise = sticky_still = record_history = true;
+ auto_split_type = false;
randr_base = 0;
exit_status = 0;
}
int exit_status;
bool auto_raise;
+bool auto_split_type;
bool sticky_still;
bool record_history;
bool running;
#define LAYOUT_CHR(A) ((A) == LAYOUT_TILED ? 'T' : 'M')
#define CHILD_POL_STR(A) ((A) == FIRST_CHILD ? "first_child" : "second_child")
#define AUTO_SCM_STR(A) ((A) == SCHEME_LONGEST_SIDE ? "longest_side" : "spiral")
+#define REM_ADJ_STR(A) ((A) == ADJUSTMENT_LONGEST_SIDE ? "longest_side" : "none")
#define TIGHTNESS_STR(A) ((A) == TIGHTNESS_HIGH ? "high" : "low")
#define SPLIT_TYPE_STR(A) ((A) == TYPE_HORIZONTAL ? "horizontal" : "vertical")
#define SPLIT_MODE_STR(A) ((A) == MODE_AUTOMATIC ? "automatic" : "manual")
fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
return;
}
+ } else if (streq("removal_adjustment", name)) {
+ removal_adjustment_t r;
+ if (parse_removal_adjustment(value, &r)) {
+ removal_adjustment = r;
+ } else {
+ fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+ return;
+ }
} else if (streq("mapping_events_count", name)) {
if (sscanf(value, "%" SCNi8, &mapping_events_count) != 1) {
fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
fprintf(rsp, "%s", CHILD_POL_STR(initial_polarity));
} else if (streq("automatic_scheme", name)) {
fprintf(rsp, "%s", AUTO_SCM_STR(automatic_scheme));
+ } else if (streq("removal_adjustment", name)) {
+ fprintf(rsp, "%s", REM_ADJ_STR(removal_adjustment));
} else if (streq("mapping_events_count", name)) {
fprintf(rsp, "%" PRIi8, mapping_events_count);
} else if (streq("directional_focus_tightness", name)) {
return false;
}
+bool parse_removal_adjustment(char *s, removal_adjustment_t *r)
+{
+ if (streq("longest_side", s)) {
+ *r = ADJUSTMENT_LONGEST_SIDE;
+ return true;
+ } else if (streq("none", s)) {
+ *r = ADJUSTMENT_NONE;
+ return true;
+ }
+ return false;
+}
+
bool parse_state_transition(char *s, state_transition_t *m)
{
if (streq("none", s)) {
bool parse_pointer_action(char *s, pointer_action_t *a);
bool parse_child_polarity(char *s, child_polarity_t *p);
bool parse_automatic_scheme(char *s, automatic_scheme_t *a);
+bool parse_removal_adjustment(char *s, removal_adjustment_t *r);
bool parse_state_transition(char *s, state_transition_t *m);
bool parse_tightness(char *s, tightness_t *t);
bool parse_degree(char *s, int *d);
border_width = BORDER_WIDTH;
split_ratio = SPLIT_RATIO;
initial_polarity = SECOND_CHILD;
- automatic_scheme = SCHEME_LONGEST_SIDE;
+ automatic_scheme = AUTOMATIC_SCHEME;
+ removal_adjustment = REMOVAL_ADJUSTMENT;
directional_focus_tightness = TIGHTNESS_HIGH;
pointer_modifier = POINTER_MODIFIER;
#define BORDER_WIDTH 1
#define SPLIT_RATIO 0.5
#define AUTOMATIC_SCHEME SCHEME_LONGEST_SIDE
+#define REMOVAL_ADJUSTMENT ADJUSTMENT_LONGEST_SIDE
#define BORDERLESS_MONOCLE false
#define GAPLESS_MONOCLE false
double split_ratio;
child_polarity_t initial_polarity;
automatic_scheme_t automatic_scheme;
+removal_adjustment_t removal_adjustment;
tightness_t directional_focus_tightness;
uint16_t pointer_modifier;
first_rect = second_rect = rect;
} else {
unsigned int fence;
+ if (auto_split_type) {
+ n->split_type = n->rectangle.width > n->rectangle.height ? TYPE_VERTICAL : TYPE_HORIZONTAL;
+ }
if (n->split_type == TYPE_VERTICAL) {
fence = rect.width * n->split_ratio;
if ((n->first_child->constraints.min_width + n->second_child->constraints.min_width) <= rect.width) {
SCHEME_SPIRAL
} automatic_scheme_t;
+typedef enum {
+ ADJUSTMENT_LONGEST_SIDE,
+ ADJUSTMENT_NONE
+} removal_adjustment_t;
+
typedef enum {
STATE_TILED,
STATE_PSEUDO_TILED,
coordinates_t loc;
if (locate_window(win, &loc)) {
put_status(SBSC_MASK_NODE_REMOVE, "node_remove 0x%08X 0x%08X 0x%08X\n", loc.monitor->id, loc.desktop->id, win);
+ if (removal_adjustment == ADJUSTMENT_LONGEST_SIDE) {
+ auto_split_type = true;
+ }
remove_node(loc.monitor, loc.desktop, loc.node);
arrange(loc.monitor, loc.desktop);
+ auto_split_type = false;
} else {
for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next) {
if (pr->win == win) {