From ce6e3de7b6718706954a64169717ac734171d98e Mon Sep 17 00:00:00 2001 From: bi4k8 Date: Sun, 27 Feb 2022 03:01:14 +0000 Subject: [PATCH] do not clear/reset focus on the same surface this regressed in ce38d2d the previous behavior broke double-click selection in the foot terminal emulator --- src/cursor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cursor.c b/src/cursor.c index cae2053a..c9860372 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -23,6 +23,16 @@ cursor_rebase(struct seat *seat, uint32_t time_msec) seat->cursor->y, &surface, &sx, &sy, &view_area); if (surface) { + struct view *focused_view = desktop_focused_view(seat->server); + struct wlr_surface* focused_surface = focused_view + ? focused_view->surface + : NULL; + + /* do not notify unless rebasing changes which surface has focus */ + if (surface == focused_surface) { + return; + } + wlr_seat_pointer_notify_clear_focus(seat->seat); wlr_seat_pointer_notify_enter(seat->seat, surface, sx, sy); wlr_seat_pointer_notify_motion(seat->seat, time_msec, sx, sy);