From 8a77ab083fbd81c450becf23dda4a80e397da575 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 27 May 2025 10:35:21 +0200 Subject: [PATCH] Revert "xwayland: Update sprite prior to clearing the focus window" This breaks regular toplevel enter/leave events when crossing to/from a native Wayland window. A better fix for the original issue follows. This reverts commit b97b459c060b103aed1a0246ee87a46cc7e51f6c. Part-of: --- hw/xwayland/xwayland-input.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index f7a8d2165..35905829e 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -616,19 +616,21 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer, { struct xwl_seat *xwl_seat = data; struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; + Bool focus_lost = FALSE; xwl_screen->serial = serial; - if (xwl_screen->rootless) - xwl_seat_leave_ptr(xwl_seat, !!xwl_seat->focus_window); - /* The pointer has left a known xwindow, save it for a possible match * in sprite_check_lost_focus() */ if (xwl_seat->focus_window) { xwl_seat->last_focus_window = xwl_seat->focus_window; xwl_seat->focus_window = NULL; + focus_lost = TRUE; } + + if (xwl_screen->rootless) + xwl_seat_leave_ptr(xwl_seat, focus_lost); } static void