Fixes #343.
Fixes #643.
_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 split_ratio 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 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 split_ratio 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 split_ratio 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 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 split_ratio 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 -a look behaviour input
# Boolean settings are identified by index!
look=(borderless_monocle gapless_monocle {normal,active,focused}_border_color {top,right,bottom,left}_padding presel_feedback_color border_width window_gap)
- behaviour=(single_monocle mapping_events_count ignore_ewmh_focus center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors status_prefix external_rules_command split_ratio initial_polarity directional_focus_tightness status_prefix)
+ behaviour=(single_monocle mapping_events_count ignore_ewmh_focus ignore_ewmh_fullscreen center_pseudo_tiled honor_size_hints remove_disabled_monitors remove_unplugged_monitors merge_overlapping_monitors status_prefix external_rules_command split_ratio initial_polarity directional_focus_tightness status_prefix)
input=({swallow_first_click,focus_follows_pointer,pointer_follows_{focus,monitor}} click_to_focus pointer_motion_interval pointer_modifier pointer_action{1,2,3} )
if [[ "$CURRENT" == (2|3) ]];then
_arguments \
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 03/07/2018
+.\" Date: 03/14/2018
.\" Manual: Bspwm Manual
-.\" Source: Bspwm 0.9.3-57-g582a843
+.\" Source: Bspwm 0.9.3-59-g14d575a
.\" Language: English
.\"
-.TH "BSPWM" "1" "03/07/2018" "Bspwm 0\&.9\&.3\-57\-g582a843" "Bspwm Manual"
+.TH "BSPWM" "1" "03/14/2018" "Bspwm 0\&.9\&.3\-59\-g14d575a" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Ignore EWMH focus requests coming from applications\&.
.RE
.PP
+\fIignore_ewmh_fullscreen\fR
+.RS 4
+Block the fullscreen state transitions that originate from an EWMH request\&. The possible values are:
+\fBnone\fR,
+\fBall\fR, or a comma separated list of the following values:
+\fBenter\fR,
+\fBexit\fR\&.
+.RE
+.PP
\fIcenter_pseudo_tiled\fR
.RS 4
Center pseudo tiled windows into their tiling rectangles\&. Defaults to
'ignore_ewmh_focus'::
Ignore EWMH focus requests coming from applications.
+'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*.
+
'center_pseudo_tiled'::
Center pseudo tiled windows into their tiling rectangles. Defaults to 'true'.
void handle_state(monitor_t *m, desktop_t *d, node_t *n, xcb_atom_t state, unsigned int action)
{
if (state == ewmh->_NET_WM_STATE_FULLSCREEN) {
- if (action == XCB_EWMH_WM_STATE_ADD) {
+ if (action == XCB_EWMH_WM_STATE_ADD && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) {
set_state(m, d, n, STATE_FULLSCREEN);
- } else if (action == XCB_EWMH_WM_STATE_REMOVE) {
+ } else if (action == XCB_EWMH_WM_STATE_REMOVE && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0) {
if (n->client->state == STATE_FULLSCREEN) {
set_state(m, d, n, n->client->last_state);
}
} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
- set_state(m, d, n, IS_FULLSCREEN(n->client) ? n->client->last_state : STATE_FULLSCREEN);
+ client_state_t next_state = IS_FULLSCREEN(n->client) ? n->client->last_state : STATE_FULLSCREEN;
+ if ((next_state == STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) ||
+ (next_state != STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0)) {
+ set_state(m, d, n, next_state);
+ }
}
arrange(m, d);
} else if (state == ewmh->_NET_WM_STATE_BELOW) {
fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
return;
}
+ } else if (streq("ignore_ewmh_fullscreen", name)) {
+ state_transition_t m;
+ if (parse_state_transition(value, &m)) {
+ ignore_ewmh_fullscreen = m;
+ } else {
+ fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+ return;
+ }
} else if (streq("pointer_modifier", name)) {
if (parse_modifier_mask(value, &pointer_modifier)) {
ungrab_buttons();
fprintf(rsp, "%" PRIi8, mapping_events_count);
} else if (streq("directional_focus_tightness", name)) {
fprintf(rsp, "%s", TIGHTNESS_STR(directional_focus_tightness));
+ } else if (streq("ignore_ewmh_fullscreen", name)) {
+ print_ignore_request(ignore_ewmh_fullscreen, rsp);
} else if (streq("pointer_modifier", name)) {
print_modifier_mask(pointer_modifier, rsp);
} else if (streq("click_to_focus", name)) {
return false;
}
+bool parse_state_transition(char *s, state_transition_t *m)
+{
+ if (streq("none", s)) {
+ *m = 0;
+ return true;
+ } else if (streq("all", s)) {
+ *m = STATE_TRANSITION_ENTER | STATE_TRANSITION_EXIT;
+ return true;
+ } else {
+ state_transition_t w = 0;
+ char *x = copy_string(s, strlen(s));
+ char *key = strtok(x, ",");
+ while (key != NULL) {
+ if (streq("enter", key)) {
+ w |= STATE_TRANSITION_ENTER;
+ } else if (streq("exit", key)) {
+ w |= STATE_TRANSITION_EXIT;
+ } else {
+ free(x);
+ return false;
+ }
+ key = strtok(NULL, ",");
+ }
+ free(x);
+ if (w != 0) {
+ *m = w;
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return false;
+}
+
bool parse_tightness(char *s, tightness_t *t)
{
if (streq("high", s)) {
bool parse_button_index(char *s, int8_t *b);
bool parse_pointer_action(char *s, pointer_action_t *a);
bool parse_child_polarity(char *s, child_polarity_t *p);
+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);
bool parse_id(char *s, uint32_t *id);
fprintf(rsp, "%s\n", d->name);
}
+void print_ignore_request(state_transition_t st, FILE *rsp)
+{
+ if (st == 0) {
+ fprintf(rsp, "none");
+ } else {
+ unsigned int cnt = 0;
+ if (st & STATE_TRANSITION_ENTER) {
+ fprintf(rsp, "enter");
+ cnt++;
+ }
+ if (st & STATE_TRANSITION_EXIT) {
+ fprintf(rsp, "%sexit", cnt > 0 ? "," : "");
+ }
+ }
+}
+
void print_modifier_mask(uint16_t m, FILE *rsp)
{
switch (m) {
void fprint_monitor_name(monitor_t *m, FILE *rsp);
void fprint_desktop_id(desktop_t *d, FILE *rsp);
void fprint_desktop_name(desktop_t *d, FILE *rsp);
+void print_ignore_request(state_transition_t st, FILE *rsp);
void print_modifier_mask(uint16_t m, FILE *rsp);
void print_button_index(int8_t b, FILE *rsp);
void print_pointer_action(pointer_action_t a, FILE *rsp);
click_to_focus = CLICK_TO_FOCUS;
swallow_first_click = SWALLOW_FIRST_CLICK;
ignore_ewmh_focus = IGNORE_EWMH_FOCUS;
+ ignore_ewmh_fullscreen = IGNORE_EWMH_FULLSCREEN;
center_pseudo_tiled = CENTER_PSEUDO_TILED;
honor_size_hints = HONOR_SIZE_HINTS;
#define CLICK_TO_FOCUS -1
#define SWALLOW_FIRST_CLICK false
#define IGNORE_EWMH_FOCUS false
+#define IGNORE_EWMH_FULLSCREEN 0
#define CENTER_PSEUDO_TILED true
#define HONOR_SIZE_HINTS false
int8_t click_to_focus;
bool swallow_first_click;
bool ignore_ewmh_focus;
+state_transition_t ignore_ewmh_fullscreen;
bool center_pseudo_tiled;
bool honor_size_hints;
TIGHTNESS_HIGH,
} tightness_t;
+typedef enum {
+ STATE_TRANSITION_ENTER = 1 << 0,
+ STATE_TRANSITION_EXIT = 1 << 1,
+} state_transition_t;
+
typedef struct {
option_bool_t automatic;
option_bool_t focused;