aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-04-19 15:24:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-04-19 15:24:25 +0000
commit876044df8d5912f814423815dadd6c192f0cd644 (patch)
tree107882895b36f6730dcc6a6106a7ca27be435359
parentsearch: add comment to ‘advance_pos()’ macro (diff)
wayland: remove selection_override_modmask member
This member is no longer valid - we need to use one from the current key-binding set.
-rw-r--r--pgo/pgo.c22
-rw-r--r--terminal.c4
-rw-r--r--wayland.h2
3 files changed, 25 insertions, 3 deletions
diff --git a/pgo/pgo.c b/pgo/pgo.c
index 4b979990..26e0c10e 100644
--- a/pgo/pgo.c
+++ b/pgo/pgo.c
@@ -13,6 +13,7 @@
#include "async.h"
#include "config.h"
+#include "key-binding.h"
#include "reaper.h"
#include "sixel.h"
#include "user-notification.h"
@@ -170,6 +171,27 @@ void get_current_modifiers(const struct seat *seat,
xkb_mod_mask_t *effective,
xkb_mod_mask_t *consumed, uint32_t key) {}
+static struct key_binding_set kbd;
+static bool kbd_initialized = false;
+
+struct key_binding_set *
+key_binding_for(
+ struct key_binding_manager *mgr, const struct terminal *term,
+ const struct seat *seat)
+{
+ if (!kbd_initialized) {
+ kbd_initialized = true;
+ kbd = (struct key_binding_set){
+ .key = tll_init(),
+ .search = tll_init(),
+ .url = tll_init(),
+ .mouse = tll_init(),
+ .selection_overrides = 0,
+ };
+ }
+
+ return &kbd;
+}
int
main(int argc, const char *const *argv)
diff --git a/terminal.c b/terminal.c
index 389024f8..f1b05f57 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2859,7 +2859,9 @@ term_mouse_grabbed(const struct terminal *term, const struct seat *seat)
xkb_mod_mask_t mods;
get_current_modifiers(seat, &mods, NULL, 0);
- const xkb_mod_mask_t override_modmask = seat->kbd.selection_override_modmask;
+ const struct key_binding_set *bindings =
+ key_binding_for(term->wl->key_binding_manager, term, seat);
+ const xkb_mod_mask_t override_modmask = bindings->selection_overrides;
bool override_mods_pressed = (mods & override_modmask) == override_modmask;
return term->mouse_tracking == MOUSE_NONE ||
diff --git a/wayland.h b/wayland.h
index f0c9baa3..2e8dcd98 100644
--- a/wayland.h
+++ b/wayland.h
@@ -111,8 +111,6 @@ struct seat {
xkb_mod_mask_t bind_significant;
xkb_mod_mask_t kitty_significant;
- xkb_mod_mask_t selection_override_modmask;
-
xkb_keycode_t key_arrow_up;
xkb_keycode_t key_arrow_down;