From 1783bc69fff6dfb044ce88524d6bd7a9aef3528d Mon Sep 17 00:00:00 2001 From: Samuel Tribe Date: Fri, 23 Nov 2018 14:37:55 +0000 Subject: [PATCH] Add setting: presel_feedback --- contrib/bash_completion | 2 +- contrib/fish_completion | 2 +- contrib/zsh_completion | 2 +- doc/bspwm.1 | 6 ++++++ doc/bspwm.1.asciidoc | 3 +++ src/messages.c | 2 ++ src/settings.c | 1 + src/settings.h | 2 ++ src/window.c | 2 +- 9 files changed, 18 insertions(+), 4 deletions(-) diff --git a/contrib/bash_completion b/contrib/bash_completion index 31a934b..059612c 100644 --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -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 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 ignore_ewmh_struts 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 presel_feedback 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 ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors' COMPREPLY=() diff --git a/contrib/fish_completion b/contrib/fish_completion index 2524ef3..c76cde5 100644 --- a/contrib/fish_completion +++ b/contrib/fish_completion @@ -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 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 ignore_ewmh_struts 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 presel_feedback 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 ignore_ewmh_struts center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors' diff --git a/contrib/zsh_completion b/contrib/zsh_completion index 903d6d2..0638ac6 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -315,7 +315,7 @@ _bspc() { ;; (config) local -a {look,behaviour,input}{_bool,} - look_bool=(borderless_monocle gapless_monocle) + look_bool=(presel_feedback 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 removal_adjustment ignore_ewmh_focus ignore_ewmh_struts 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) diff --git a/doc/bspwm.1 b/doc/bspwm.1 index fe447ac..f7a9994 100644 --- a/doc/bspwm.1 +++ b/doc/bspwm.1 @@ -1186,6 +1186,12 @@ side of another window\&. Accept the following values: Adjust the brother when unlinking a node from the tree in accordance with the automatic insertion scheme\&. .RE .PP +\fIpresel_feedback\fR +.RS 4 +Draw the preselection feedback area\&. Defaults to +\fItrue\fR\&. +.RE +.PP \fIborderless_monocle\fR .RS 4 Remove borders of tiled windows for the diff --git a/doc/bspwm.1.asciidoc b/doc/bspwm.1.asciidoc index 20d9298..823c677 100644 --- a/doc/bspwm.1.asciidoc +++ b/doc/bspwm.1.asciidoc @@ -696,6 +696,9 @@ Global Settings 'removal_adjustment':: Adjust the brother when unlinking a node from the tree in accordance with the automatic insertion scheme. +'presel_feedback':: + Draw the preselection feedback area. Defaults to 'true'. + 'borderless_monocle':: Remove borders of tiled windows for the *monocle* desktop layout. diff --git a/src/messages.c b/src/messages.c index 0703571..c80f957 100644 --- a/src/messages.c +++ b/src/messages.c @@ -1666,6 +1666,7 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp) fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value); \ return; \ } + SET_BOOL(presel_feedback) SET_BOOL(borderless_monocle) SET_BOOL(gapless_monocle) SET_BOOL(single_monocle) @@ -1794,6 +1795,7 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp) #define GET_BOOL(s) \ } else if (streq(#s, name)) { \ fprintf(rsp, "%s", BOOL_STR(s)); + GET_BOOL(presel_feedback) GET_BOOL(borderless_monocle) GET_BOOL(gapless_monocle) GET_BOOL(single_monocle) diff --git a/src/settings.c b/src/settings.c index a937544..8dc7ef9 100644 --- a/src/settings.c +++ b/src/settings.c @@ -69,6 +69,7 @@ void load_settings(void) pointer_actions[2] = ACTION_RESIZE_CORNER; mapping_events_count = MAPPING_EVENTS_COUNT; + presel_feedback = PRESEL_FEEDBACK; borderless_monocle = BORDERLESS_MONOCLE; gapless_monocle = GAPLESS_MONOCLE; single_monocle = SINGLE_MONOCLE; diff --git a/src/settings.h b/src/settings.h index a0f1874..803b7e1 100644 --- a/src/settings.h +++ b/src/settings.h @@ -45,6 +45,7 @@ #define AUTOMATIC_SCHEME SCHEME_LONGEST_SIDE #define REMOVAL_ADJUSTMENT true +#define PRESEL_FEEDBACK true #define BORDERLESS_MONOCLE false #define GAPLESS_MONOCLE false #define SINGLE_MONOCLE false @@ -88,6 +89,7 @@ uint32_t pointer_motion_interval; pointer_action_t pointer_actions[3]; int8_t mapping_events_count; +bool presel_feedback; bool borderless_monocle; bool gapless_monocle; bool single_monocle; diff --git a/src/window.c b/src/window.c index 3571661..d91ad0d 100644 --- a/src/window.c +++ b/src/window.c @@ -284,7 +284,7 @@ void initialize_presel_feedback(node_t *n) void draw_presel_feedback(monitor_t *m, desktop_t *d, node_t *n) { - if (n == NULL || n->presel == NULL || d->layout == LAYOUT_MONOCLE) { + if (n == NULL || n->presel == NULL || d->layout == LAYOUT_MONOCLE || !presel_feedback) { return; }