]> git.lizzy.rs Git - bspwm.git/commitdiff
Add setting: swallow_first_click
authorBastien Dejean <nihilhill@gmail.com>
Thu, 17 Nov 2016 17:07:26 +0000 (18:07 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Thu, 17 Nov 2016 17:07:26 +0000 (18:07 +0100)
contrib/bash_completion
contrib/fish_completion
contrib/zsh_completion
doc/bspwm.1
doc/bspwm.1.asciidoc
events.c
messages.c
settings.c
settings.h

index c04fa57b0a562049b2134656a69eeec82d9ddeef..4bc76c738c549ef71b786688de885ed7d37a2dde 100644 (file)
@@ -1,7 +1,7 @@
 _bspc() {
        local commands='node desktop monitor query rule restore 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 borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus 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 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'
 
        COMPREPLY=()
 
index eb936f8070a5e5a2b910634d2d0307bfe3b6996a..78da934d6146776dc64b8a73f0755972530fbf27 100644 (file)
@@ -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 restore 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 borderless_monocle gapless_monocle single_monocle pointer_motion_interval pointer_modifier pointer_action1 pointer_action2 pointer_action3 click_to_focus 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 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'
index 57281d82f439b418b45187c006562d9423dd0bea..f97a2488d5950cc9f34777b7d98e030eb53bcef5 100644 (file)
@@ -3,7 +3,7 @@
 _bspc() {
        local -a commands settings
        commands=('node' 'desktop' 'monitor' 'query' 'rule' 'restore' 'wm' 'subscribe' 'config' 'quit')
-       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' 'borderless_monocle' 'gapless_monocle' 'single_monocle' 'pointer_motion_interval' 'pointer_modifier' 'pointer_action1' 'pointer_action2' 'pointer_action3' 'click_to_focus' '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')
+       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' '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')
        if (( CURRENT == 2 )) ; then
                _values 'command' "$commands[@]"
        elif (( CURRENT == 3 )) ; then
index ec7855e7fdb9222dda6b9343b89d5f68a108d37a..1c36f70d3e363aca2967265a7e717063ce7ec4b0 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 11/13/2016
+.\"      Date: 11/17/2016
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.2-5-gb14ec64
+.\"    Source: Bspwm 0.9.2-9-g201f6e6
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "11/13/2016" "Bspwm 0\&.9\&.2\-5\-gb14ec64" "Bspwm Manual"
+.TH "BSPWM" "1" "11/17/2016" "Bspwm 0\&.9\&.2\-9\-g201f6e6" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1111,6 +1111,13 @@ Action performed when pressing
 Focus a window (or a monitor) by clicking it\&.
 .RE
 .PP
+\fIswallow_first_click\fR
+.RS 4
+Don\(cqt replay the click that makes a window focused when
+\fIclick_to_focus\fR
+is set\&.
+.RE
+.PP
 \fIfocus_follows_pointer\fR
 .RS 4
 Focus the window under the pointer\&.
index 73ed3ea7995f71d82a28853b568f0780e91b0b01..468316482c69ee56f006b904a5d1b860e8229423 100644 (file)
@@ -650,6 +650,9 @@ Global Settings
 'click_to_focus'::
        Focus a window (or a monitor) by clicking it.
 
+'swallow_first_click'::
+       Don't replay the click that makes a window focused when 'click_to_focus' is set.
+
 'focus_follows_pointer'::
        Focus the window under the pointer.
 
index 360d9ea1dabc2851365e53219bb37f82dfc45716..bbcceebebba513a33ce1eaab58224c8a316670ca 100644 (file)
--- a/events.c
+++ b/events.c
@@ -341,7 +341,7 @@ void button_press(xcb_generic_event_t *evt)
                                bool pfm = pointer_follows_monitor;
                                pointer_follows_focus = false;
                                pointer_follows_monitor = false;
-                               replay = !grab_pointer(ACTION_FOCUS);
+                               replay = !grab_pointer(ACTION_FOCUS) || !swallow_first_click;
                                pointer_follows_focus = pff;
                                pointer_follows_monitor = pfm;
                        } else {
index 9bd0391427201a27f348398842e79ac8862479f5..fccad2e0eac2e765defc26366032135c7651e209 100644 (file)
@@ -1499,6 +1499,7 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                SET_BOOL(gapless_monocle)
                SET_BOOL(paddingless_monocle)
                SET_BOOL(single_monocle)
+               SET_BOOL(swallow_first_click)
                SET_BOOL(pointer_follows_focus)
                SET_BOOL(pointer_follows_monitor)
                SET_BOOL(ignore_ewmh_focus)
@@ -1608,6 +1609,7 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp)
        GET_BOOL(paddingless_monocle)
        GET_BOOL(single_monocle)
        GET_BOOL(click_to_focus)
+       GET_BOOL(swallow_first_click)
        GET_BOOL(focus_follows_pointer)
        GET_BOOL(pointer_follows_focus)
        GET_BOOL(pointer_follows_monitor)
index 1af156a1306e7ddcffe82a46230639b111e74060..a17cff59c6f16b8368b12592dd70f0c84463cd5b 100644 (file)
@@ -72,6 +72,7 @@ void load_settings(void)
        ignore_ewmh_focus = IGNORE_EWMH_FOCUS;
        center_pseudo_tiled = CENTER_PSEUDO_TILED;
        click_to_focus = CLICK_TO_FOCUS;
+       swallow_first_click = SWALLOW_FIRST_CLICK;
        honor_size_hints = HONOR_SIZE_HINTS;
        remove_disabled_monitors = REMOVE_DISABLED_MONITORS;
        remove_unplugged_monitors = REMOVE_UNPLUGGED_MONITORS;
index 47ebb6e913b2eac46de053cd2e52622a26da4524..f8ed182a2d3878f5b4c7fc754a7b4a9147d78f88 100644 (file)
@@ -55,6 +55,7 @@
 #define IGNORE_EWMH_FOCUS           false
 #define CENTER_PSEUDO_TILED         true
 #define CLICK_TO_FOCUS              false
+#define SWALLOW_FIRST_CLICK         false
 #define HONOR_SIZE_HINTS            false
 #define REMOVE_DISABLED_MONITORS    false
 #define REMOVE_UNPLUGGED_MONITORS   false
@@ -88,6 +89,7 @@ bool pointer_follows_monitor;
 bool ignore_ewmh_focus;
 bool center_pseudo_tiled;
 bool click_to_focus;
+bool swallow_first_click;
 bool honor_size_hints;
 bool remove_disabled_monitors;
 bool remove_unplugged_monitors;