Merge pull request #1054 from swaywm/cancel-grab-on-focus-change

rootston: Cancel existing keyboard grab when changing focus
This commit is contained in:
Tony Crisci 2018-06-24 18:38:52 -04:00 committed by GitHub
commit 0fa784de0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -825,6 +825,9 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
view_activate(view, true); view_activate(view, true);
seat->has_focus = true; seat->has_focus = true;
// An existing keyboard grab might try to deny setting focus, so cancel it
wlr_seat_keyboard_end_grab(seat->seat);
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->seat); struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->seat);
if (keyboard != NULL) { if (keyboard != NULL) {
wlr_seat_keyboard_notify_enter(seat->seat, view->wlr_surface, wlr_seat_keyboard_notify_enter(seat->seat, view->wlr_surface,