config, input: allow configuring select-override modifiers

This commit is contained in:
feeptr@codeberg.org 2021-09-27 19:09:07 +00:00
parent 281127cae1
commit a4d53bdf88
6 changed files with 100 additions and 19 deletions

View file

@ -2826,10 +2826,15 @@ term_mouse_grabbed(const struct terminal *term, struct seat *seat)
/*
* Mouse is grabbed by us, regardless of whether mouse tracking has been enabled or not.
*/
xkb_mod_mask_t mods;
get_current_modifiers(seat, &mods, NULL, 0);
const xkb_mod_mask_t override_modmask = seat->kbd.selection_override_modmask;
bool override_mods_pressed = (mods & override_modmask) == override_modmask;
return term->mouse_tracking == MOUSE_NONE ||
(seat->kbd_focus == term &&
seat->kbd.shift &&
!seat->kbd.alt && /*!seat->kbd.ctrl &&*/ !seat->kbd.super);
(seat->kbd_focus == term && override_mods_pressed);
}
void