From cd4b6cda975ea0e6bf775bfa985683c98b9d2113 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 14 Jun 2020 10:53:59 +0200 Subject: [PATCH] clear focus if surface is NULL --- dwl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 5e89eef..c1be5d1 100644 --- a/dwl.c +++ b/dwl.c @@ -595,9 +595,11 @@ focusclient(Client *c, struct wlr_surface *surface, int lift) * If the focused surface has changed, tell the seat to have the * keyboard enter the new surface. wlroots will keep track of this and * automatically send key events to the appropriate clients. If surface - * is NULL, this will clear focus. + * is NULL, we clear the focus instead. */ - if (surface && (surface != psurface)) { + if (!surface) { + wlr_seat_pointer_notify_clear_focus(seat); + } else if (surface != psurface) { kb = wlr_seat_get_keyboard(seat); wlr_seat_keyboard_notify_enter(seat, surface, kb->keycodes, kb->num_keycodes, &kb->modifiers);