Add mouse binding pointer position configuration

Add the `--whole-window` switch for mouse bindings. This switch controls
what part of the container the pointer must be over to trigger a mouse
binding. The default is to only trigger mouse bindings over the
titlebars. With this switch, a mouse binding will be triggered over the
main part of the window as well.

This is a breaking change to the previous behavior, which would trigger
a mouse binding with a modifier over any part of the window.

fixes #1429
This commit is contained in:
Tony Crisci
2015-01-29 20:52:52 -05:00
committed by Michael Stapelberg
parent f28ce227e3
commit 74b69d6d02
9 changed files with 34 additions and 22 deletions

View File

@ -24,7 +24,7 @@ const char *DEFAULT_BINDING_MODE;
*
*/
Binding *configure_binding(const char *bindtype, const char *modifiers, const char *input_code,
const char *release, const char *command, const char *mode);
const char *release, const char *whole_window, const char *command, const char *mode);
/**
* Grab the bound keys (tell X to send us keypress events for those keycodes)

View File

@ -61,10 +61,10 @@ CFGFUN(color_single, const char *colorclass, const char *color);
CFGFUN(floating_modifier, const char *modifiers);
CFGFUN(new_window, const char *windowtype, const char *border, const long width);
CFGFUN(workspace, const char *workspace, const char *output);
CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command);
CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command);
CFGFUN(enter_mode, const char *mode);
CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command);
CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command);
CFGFUN(bar_font, const char *font);
CFGFUN(bar_mode, const char *mode);

View File

@ -255,6 +255,11 @@ struct Binding {
B_UPON_KEYRELEASE_IGNORE_MODS = 2,
} release;
/** If this is true for a mouse binding, the binding should be executed
* when the button is pressed over any part of the window, not just the
* title bar (default). */
bool whole_window;
uint32_t number_keycodes;
/** Keycode to bind */