From 544c1b1976544085a2f27497c5c516bf1d9edfa3 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 9 Aug 2020 22:40:53 +0200 Subject: config: wip: add support for modifiers in mouse bindings Mouse bindings can now include modifiers. They are specified in pretty much the same way as in keyboard bindings: Control+BTN_LEFT --- wayland.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index a10ed2b3..30271dd2 100644 --- a/wayland.c +++ b/wayland.c @@ -125,6 +125,8 @@ seat_destroy(struct seat *seat) tll_free(it->item.bind.key_codes); tll_free(seat->kbd.bindings.search); + tll_free(seat->mouse.bindings); + if (seat->kbd.xkb_compose_state != NULL) xkb_compose_state_unref(seat->kbd.xkb_compose_state); if (seat->kbd.xkb_compose_table != NULL) @@ -762,9 +764,6 @@ handle_global(void *data, struct wl_registry *registry, struct wl_seat *wl_seat = wl_registry_bind( wayl->registry, name, &wl_seat_interface, required); - /* Clipboard */ - /* Primary selection */ - tll_push_back(wayl->seats, ((struct seat){ .wayl = wayl, .wl_seat = wl_seat, -- cgit v1.3 From 6b18bd998a08eee404fbdb73a1a71627377b874b Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 10 Aug 2020 18:57:17 +0200 Subject: wayland: global-remove: fix call to pointer_listener.leave() Don't call it when we have keyboard focus, call it when we have mouse focus. --- wayland.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index 30271dd2..ec6c7896 100644 --- a/wayland.c +++ b/wayland.c @@ -912,18 +912,22 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) if (seat->kbd_focus != NULL) { LOG_WARN("compositor destroyed seat '%s' " - "without sending keyboard/pointer leave events", + "without sending a keyboard leave event", seat->name); - struct terminal *term = seat->kbd_focus; - if (seat->wl_keyboard != NULL) keyboard_listener.leave( - seat, seat->wl_keyboard, -1, term->window->surface); + seat, seat->wl_keyboard, -1, seat->kbd_focus->window->surface); + } + + if (seat->mouse_focus != NULL) { + LOG_WARN("compositor destroyed seat '%s' " + "without sending a pointer leave event", + seat->name); if (seat->wl_pointer != NULL) pointer_listener.leave( - seat, seat->wl_pointer, -1, term->window->surface); + seat, seat->wl_pointer, -1, seat->mouse_focus->window->surface); } seat_destroy(seat); -- cgit v1.3 From 49eea3893e91b6c3df90e53c0403a976bf1cda52 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 10 Aug 2020 18:58:39 +0200 Subject: wayland: global-remove: return after finding a matching seat --- wayland.c | 1 + 1 file changed, 1 insertion(+) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index ec6c7896..385e2098 100644 --- a/wayland.c +++ b/wayland.c @@ -932,6 +932,7 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) seat_destroy(seat); tll_remove(wayl->seats, it); + return; } LOG_WARN("unknown global removed: 0x%08x", name); -- cgit v1.3