From 04f77fe2b7503f27e2a07ba498d6d44098c64a85 Mon Sep 17 00:00:00 2001 From: Cosmo Borsky Date: Thu, 24 Jan 2019 23:52:08 -0500 Subject: [PATCH] Add `ignore_ewmh_struts` config option Fixes #906. --- contrib/bash_completion | 2 +- contrib/fish_completion | 2 +- contrib/zsh_completion | 2 +- doc/bspwm.1 | 11 ++++++++--- doc/bspwm.1.asciidoc | 3 +++ src/events.c | 2 +- src/messages.c | 2 ++ src/settings.h | 1 + src/window.c | 2 +- 9 files changed, 19 insertions(+), 8 deletions(-) diff --git a/contrib/bash_completion b/contrib/bash_completion index 9990807..31a934b 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 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 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 6bf479f..2524ef3 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 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 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 4e9948d..903d6d2 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -317,7 +317,7 @@ _bspc() { local -a {look,behaviour,input}{_bool,} 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 removal_adjustment ignore_ewmh_focus center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors) + 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) 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}) diff --git a/doc/bspwm.1 b/doc/bspwm.1 index af49b50..fe447ac 100644 --- a/doc/bspwm.1 +++ b/doc/bspwm.1 @@ -2,12 +2,12 @@ .\" Title: bspwm .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 01/15/2019 +.\" Date: 01/24/2019 .\" Manual: Bspwm Manual -.\" Source: Bspwm 0.9.5-28-g3e7f820 +.\" Source: Bspwm 0.9.5-31-ga8b40f5 .\" Language: English .\" -.TH "BSPWM" "1" "01/15/2019" "Bspwm 0\&.9\&.5\-28\-g3e7f820" "Bspwm Manual" +.TH "BSPWM" "1" "01/24/2019" "Bspwm 0\&.9\&.5\-31\-ga8b40f5" "Bspwm Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1300,6 +1300,11 @@ Block the fullscreen state transitions that originate from an EWMH request\&. Th \fBexit\fR\&. .RE .PP +\fIignore_ewmh_struts\fR +.RS 4 +BIgnore strut hinting from clients requesting to reserve space (i\&.e\&. task bars)\&. +.RE +.PP \fIcenter_pseudo_tiled\fR .RS 4 Center pseudo tiled windows into their tiling rectangles\&. Defaults to diff --git a/doc/bspwm.1.asciidoc b/doc/bspwm.1.asciidoc index 058022a..20d9298 100644 --- a/doc/bspwm.1.asciidoc +++ b/doc/bspwm.1.asciidoc @@ -746,6 +746,9 @@ Global Settings 'ignore_ewmh_fullscreen':: Block the fullscreen state transitions that originate from an EWMH request. The possible values are: *none*, *all*, or a comma separated list of the following values: *enter*, *exit*. +'ignore_ewmh_struts':: + BIgnore strut hinting from clients requesting to reserve space (i.e. task bars). + 'center_pseudo_tiled':: Center pseudo tiled windows into their tiling rectangles. Defaults to 'true'. diff --git a/src/events.c b/src/events.c index dc06963..483d5c8 100644 --- a/src/events.c +++ b/src/events.c @@ -260,7 +260,7 @@ void property_notify(xcb_generic_event_t *evt) { xcb_property_notify_event_t *e = (xcb_property_notify_event_t *) evt; - if (e->atom == ewmh->_NET_WM_STRUT_PARTIAL && ewmh_handle_struts(e->window)) { + if (!ignore_ewmh_struts && e->atom == ewmh->_NET_WM_STRUT_PARTIAL && ewmh_handle_struts(e->window)) { for (monitor_t *m = mon_head; m != NULL; m = m->next) { for (desktop_t *d = m->desk_head; d != NULL; d = d->next) { arrange(m, d); diff --git a/src/messages.c b/src/messages.c index 5d79801..0703571 100644 --- a/src/messages.c +++ b/src/messages.c @@ -1673,6 +1673,7 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp) SET_BOOL(pointer_follows_focus) SET_BOOL(pointer_follows_monitor) SET_BOOL(ignore_ewmh_focus) + SET_BOOL(ignore_ewmh_struts) SET_BOOL(center_pseudo_tiled) SET_BOOL(honor_size_hints) SET_BOOL(removal_adjustment) @@ -1801,6 +1802,7 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp) GET_BOOL(pointer_follows_focus) GET_BOOL(pointer_follows_monitor) GET_BOOL(ignore_ewmh_focus) + GET_BOOL(ignore_ewmh_struts) GET_BOOL(center_pseudo_tiled) GET_BOOL(honor_size_hints) GET_BOOL(removal_adjustment) diff --git a/src/settings.h b/src/settings.h index b7e9bf7..a0f1874 100644 --- a/src/settings.h +++ b/src/settings.h @@ -98,6 +98,7 @@ bool pointer_follows_monitor; int8_t click_to_focus; bool swallow_first_click; bool ignore_ewmh_focus; +bool ignore_ewmh_struts; state_transition_t ignore_ewmh_fullscreen; bool center_pseudo_tiled; diff --git a/src/window.c b/src/window.c index 9461151..6840778 100644 --- a/src/window.c +++ b/src/window.c @@ -78,7 +78,7 @@ bool manage_window(xcb_window_t win, rule_consequence_t *csq, int fd) parse_rule_consequence(fd, csq); - if (ewmh_handle_struts(win)) { + if (!ignore_ewmh_struts && ewmh_handle_struts(win)) { for (monitor_t *m = mon_head; m != NULL; m = m->next) { arrange(m, m->desk); } -- 2.44.0