wayland: refactor: remove ‘struct config’ pointer from wayland struct

The global config doesn’t necessarily reflect the correct
configuration to use - we should *always* use the current terminal
instance’s conf pointer.

* Move selection override modifier mask to the key_binding_set struct
* Always warn if XDG activation is unavailable, not just if
  bell.urgent is set (we no longer have access to this information)
* Pass ‘bool presentation_timings’ as a parameter to wayl_init()
* Remove ‘presentation_timings’ member from the ‘terminal’ struct

Closes #932
This commit is contained in:
Daniel Eklöf 2022-04-17 16:29:30 +02:00
parent 7a5e5a80b9
commit 24ee3dcc10
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
9 changed files with 30 additions and 27 deletions

19
input.c
View file

@ -489,11 +489,6 @@ keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
seat->kbd.key_arrow_down = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "DOWN");
}
/* Set selection-override modmask from configured mods and seat's mod indices */
const struct config_key_modifiers* override_mods =
&wayl->conf->mouse.selection_override_modifiers;
seat->kbd.selection_override_modmask = conf_modifiers_to_mask(seat, override_mods);
munmap(map_str, size);
close(fd);
@ -2237,17 +2232,19 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
if (seat->wl_keyboard != NULL && seat->kbd.xkb_state != NULL) {
/* Seat has keyboard - use mouse bindings *with* modifiers */
const struct key_binding_set *bindings = key_binding_for(
wayl->key_binding_manager, term, seat);
xassert(bindings != NULL);
xkb_mod_mask_t mods;
get_current_modifiers(seat, &mods, NULL, 0);
mods &= seat->kbd.bind_significant;
/* Ignore selection override modifiers when matching modifiers */
mods &= ~seat->kbd.selection_override_modmask;
/* Ignore selection override modifiers when
* matching modifiers */
mods &= ~bindings->selection_overrides;
const struct key_binding *match = NULL;
const struct key_binding_set *bindings = key_binding_for(
wayl->key_binding_manager, term, seat);
xassert(bindings != NULL);
tll_foreach(bindings->mouse, it) {
const struct key_binding *binding = &it->item;
@ -2278,7 +2275,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
else {
/* Seat does NOT have a keyboard - use mouse bindings *without* modifiers */
const struct config_key_binding *match = NULL;
const struct config *conf = seat->wayl->conf;
const struct config *conf = term->conf;
for (size_t i = 0; i < conf->bindings.mouse.count; i++) {
const struct config_key_binding *binding =