Fixes #766.
_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 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 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 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 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 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 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 \
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 03/07/2018
.\" Manual: Bspwm Manual
-.\" Source: Bspwm 0.9.3-55-g7d639d1
+.\" Source: Bspwm 0.9.3-56-g8d96aff
.\" Language: English
.\"
-.TH "BSPWM" "1" "03/07/2018" "Bspwm 0\&.9\&.3\-55\-g7d639d1" "Bspwm Manual"
+.TH "BSPWM" "1" "03/07/2018" "Bspwm 0\&.9\&.3\-56\-g8d96aff" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
When focusing a monitor, put the pointer at its center\&.
.RE
.PP
+\fImapping_events_count\fR
+.RS 4
+Handle the next
+\fBmapping_events_count\fR
+mapping notify events\&. A negative value implies that every event needs to be handled\&.
+.RE
+.PP
\fIignore_ewmh_focus\fR
.RS 4
Ignore EWMH focus requests coming from applications\&.
'pointer_follows_monitor'::
When focusing a monitor, put the pointer at its center.
+'mapping_events_count'::
+ Handle the next *mapping_events_count* mapping notify events. A negative value implies that every event needs to be handled.
+
'ignore_ewmh_focus'::
Ignore EWMH focus requests coming from applications.
case XCB_FOCUS_IN:
focus_in(evt);
break;
+ case XCB_MAPPING_NOTIFY:
+ mapping_notify(evt);
+ break;
case 0:
process_error(evt);
break;
#undef HANDLE_WM_STATE
}
+void mapping_notify(xcb_generic_event_t *evt)
+{
+ if (mapping_events_count == 0) {
+ return;
+ }
+
+ xcb_mapping_notify_event_t *e = (xcb_mapping_notify_event_t *) evt;
+
+ if (e->request == XCB_MAPPING_POINTER) {
+ return;
+ }
+
+ if (mapping_events_count > 0) {
+ mapping_events_count--;
+ }
+
+ ungrab_buttons();
+ grab_buttons();
+}
+
void process_error(xcb_generic_event_t *evt)
{
xcb_request_error_t *e = (xcb_request_error_t *) evt;
void enter_notify(xcb_generic_event_t *evt);
void motion_notify(xcb_generic_event_t *evt);
void handle_state(monitor_t *m, desktop_t *d, node_t *n, xcb_atom_t state, unsigned int action);
+void mapping_notify(xcb_generic_event_t *evt);
void process_error(xcb_generic_event_t *evt);
#endif
#include <string.h>
#include <stdbool.h>
#include <stdarg.h>
+#include <inttypes.h>
#include <unistd.h>
#include "bspwm.h"
#include "desktop.h"
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);
+ return;
+ }
} else if (streq("directional_focus_tightness", name)) {
tightness_t p;
if (parse_tightness(value, &p)) {
fprintf(rsp, "%s", status_prefix);
} else if (streq("initial_polarity", name)) {
fprintf(rsp, "%s", CHILD_POL_STR(initial_polarity));
+ } else if (streq("mapping_events_count", name)) {
+ fprintf(rsp, "%" PRIi8, mapping_events_count);
} else if (streq("directional_focus_tightness", name)) {
fprintf(rsp, "%s", TIGHTNESS_STR(directional_focus_tightness));
} else if (streq("pointer_modifier", name)) {
directional_focus_tightness = TIGHTNESS_HIGH;
pointer_modifier = POINTER_MODIFIER;
pointer_motion_interval = POINTER_MOTION_INTERVAL;
+ mapping_events_count = MAPPING_EVENTS_COUNT;
pointer_actions[0] = ACTION_MOVE;
pointer_actions[1] = ACTION_RESIZE_SIDE;
#define CENTER_PSEUDO_TILED true
#define HONOR_SIZE_HINTS false
+#define MAPPING_EVENTS_COUNT 1
#define REMOVE_DISABLED_MONITORS false
#define REMOVE_UNPLUGGED_MONITORS false
uint16_t pointer_modifier;
uint32_t pointer_motion_interval;
pointer_action_t pointer_actions[3];
+int8_t mapping_events_count;
bool borderless_monocle;
bool gapless_monocle;