aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-11 08:45:01 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-14 05:38:56 +0000
commit364412bfaa09b282389a988432cbe1aa2ad30bd8 (patch)
tree81732065ae3aef5ab5bffbd6df9cea51910ac3bb
parentconfig: don't allow Shift in mouse bindings (diff)
input: mouse-bindings: ignore Shift
Shift is used to enable selection when the client application is grabbing the mouse. As such, mouse bindings *never* have Shift as a modifier, but should still trigger when Shift is being pressed.
-rw-r--r--input.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/input.c b/input.c
index e1e061ed..d7ae76f3 100644
--- a/input.c
+++ b/input.c
@@ -1487,13 +1487,19 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
bool cursor_is_on_grid = seat->mouse.col >= 0 && seat->mouse.row >= 0;
- xkb_mod_mask_t mods = xkb_state_serialize_mods(
- seat->kbd.xkb_state, XKB_STATE_MODS_DEPRESSED);
-
switch (state) {
case WL_POINTER_BUTTON_STATE_PRESSED: {
if (seat->wl_keyboard != NULL) {
/* Seat has keyboard - use mouse bindings *with* modifiers */
+
+ xkb_mod_mask_t mods = xkb_state_serialize_mods(
+ seat->kbd.xkb_state, XKB_STATE_MODS_DEPRESSED);
+
+ /* Ignore Shift when matching modifiers, since it is
+ * used to enable selection in mouse grabbing client
+ * applications */
+ mods &= ~(1 << seat->kbd.mod_shift);
+
tll_foreach(seat->mouse.bindings, it) {
const struct mouse_binding *binding = &it->item;