input/seat: don't send redundant leave/enter on device creation

Fixes: #8143 #8173
Upstream issue: https://github.com/fcitx/fcitx5/issues/1044
This commit is contained in:
llyyr 2024-05-25 22:30:20 +05:30 committed by Simon Ser
parent dfbcd1fbaa
commit 0386b2afcb

View file

@ -802,11 +802,10 @@ static void seat_configure_keyboard(struct sway_seat *seat,
return; return;
} }
// force notify reenter to pick up the new configuration. This reuses // Notify reenter to pick up the new configuration. This reuses
// the current focused surface to avoid breaking input grabs. // the current focused surface to avoid breaking input grabs.
struct wlr_surface *surface = seat->wlr_seat->keyboard_state.focused_surface; struct wlr_surface *surface = seat->wlr_seat->keyboard_state.focused_surface;
if (surface) { if (surface) {
wlr_seat_keyboard_notify_clear_focus(seat->wlr_seat);
seat_keyboard_notify_enter(seat, surface); seat_keyboard_notify_enter(seat, surface);
} }
} }