From 84ec8f92a69feb303e0e521f482b75b2cd12c4aa Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Wed, 20 May 2020 21:20:19 -0400 Subject: Use new wlroots API for clearing keyboard/pointer focus during grabs We are not allowed to do what we did in #5222 and pass a `NULL` surface wlr_seat_pointer_notify_enter(), and it's causing crashes when an xdg-shell popup is active (see #5294 and swaywm/wlroots#2161). Instead, solve #5220 using the new wlroots API introduced in swaywm/wlroots#2217. --- sway/input/seat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sway/input/seat.c') diff --git a/sway/input/seat.c b/sway/input/seat.c index e5f15613..73a8deac 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -698,7 +698,7 @@ static void seat_configure_keyboard(struct sway_seat *seat, struct sway_node *focus = seat_get_focus(seat); if (focus && node_is_view(focus)) { // force notify reenter to pick up the new configuration - wlr_seat_keyboard_clear_focus(seat->wlr_seat); + wlr_seat_keyboard_notify_clear_focus(seat->wlr_seat); seat_keyboard_notify_enter(seat, focus->sway_container->view->surface); } } @@ -963,7 +963,7 @@ static void send_unfocus(struct sway_container *con, void *data) { // Unfocus the container and any children (eg. when leaving `focus parent`) static void seat_send_unfocus(struct sway_node *node, struct sway_seat *seat) { sway_cursor_constrain(seat->cursor, NULL); - wlr_seat_keyboard_clear_focus(seat->wlr_seat); + wlr_seat_keyboard_notify_clear_focus(seat->wlr_seat); if (node->type == N_WORKSPACE) { workspace_for_each_container(node->sway_workspace, send_unfocus, seat); } else { @@ -1230,7 +1230,7 @@ void seat_set_exclusive_client(struct sway_seat *seat, } if (seat->wlr_seat->pointer_state.focused_client) { if (seat->wlr_seat->pointer_state.focused_client->client != client) { - wlr_seat_pointer_clear_focus(seat->wlr_seat); + wlr_seat_pointer_notify_clear_focus(seat->wlr_seat); } } struct timespec now; -- cgit v1.2.3