Only grab scrollwheel buttons if necessary.

With this patch, we only grab the scrollwheel buttons (4 and 5) when
managing a window if a whole window key binding exists for these buttons.

This allows both of these usecases:
  - Bindings to scrollwheel buttons using --whole-window (see #1701).
  - Scrolling in a window without focusing it if no such binding
    exists (see #2049).

Furthermore, we drop all button grabs and regrab them after a config
reload in order to reevaluate the new bindings correctly.

fixes #2049
This commit is contained in:
Ingo Bürk
2015-11-11 20:40:25 +01:00
parent 66882bf445
commit 029d78c0bf
6 changed files with 83 additions and 4 deletions

View File

@ -165,4 +165,4 @@ void xcb_remove_property_atom(xcb_connection_t *conn, xcb_window_t window, xcb_a
* Grab the specified buttons on a window when managing it.
*
*/
void xcb_grab_buttons(xcb_connection_t *conn, xcb_window_t window, uint8_t* buttons);
void xcb_grab_buttons(xcb_connection_t *conn, xcb_window_t window, bool bind_scrollwheel);