Only grab the mouse buttons that need to be grabbed. (#2290)

This is a followup to #2049. While we had fixed that bug by only grabbing
buttons 4 and 5 if there is a whole-window binding for that button, this
did not consider buttons higher than 5 as found on many mice.

Therefore, we now ditch the special handling for scrollwheel buttons and
instead do the same for all buttons higher than 3.

fixes #2271
This commit is contained in:
Ingo Bürk
2016-04-13 19:45:57 +02:00
committed by Michael Stapelberg
parent 0060586190
commit 83c8740bf1
5 changed files with 51 additions and 34 deletions

View File

@ -104,10 +104,10 @@ CommandResult *run_binding(Binding *bind, Con *con);
bool load_keymap(void);
/**
* Returns true if the current config has any binding to a scroll wheel button
* (4 or 5) which is a whole-window binding.
* We need this to figure out whether we should grab all buttons or just 1-3
* when managing a window. See #2049.
*
* Returns a list of buttons that should be grabbed on a window.
* This list will always contain 13, all higher buttons will only be returned
* if there is a whole-window binding for it on some window in the current
* config.
* The list is terminated by a 0.
*/
bool bindings_should_grab_scrollwheel_buttons(void);
int *bindings_get_buttons_to_grab(void);