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
This commit is contained in:
bi4k8 2022-02-27 03:01:14 +00:00
parent 1d9c9d1afc
commit ce6e3de7b6

View file

@ -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);