From 36199d39d3dfc3c74609636a07b95ca07f674bf3 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Thu, 19 Jun 2025 10:43:57 +0200 Subject: [PATCH] seat: send wl_pointer.enter in get_pointer --- src/ifs/wl_seat.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/ifs/wl_seat.rs b/src/ifs/wl_seat.rs index 7de5a81a..f296891e 100644 --- a/src/ifs/wl_seat.rs +++ b/src/ifs/wl_seat.rs @@ -1156,7 +1156,26 @@ impl WlSeatRequestHandler for WlSeat { let p = Rc::new(WlPointer::new(req.id, slf)); track!(self.client, p); self.client.add_client_obj(&p)?; - self.pointers.set(req.id, p); + self.pointers.set(req.id, p.clone()); + let surface = self + .global + .pointer_node() + .and_then(|n| n.node_into_surface()); + if let Some(surface) = surface { + if surface.client.id == self.client.id { + let (x, y) = self.global.pointer_cursor.position(); + let (x_int, y_int) = surface + .buffer_abs_pos + .get() + .translate(x.round_down(), y.round_down()); + p.send_enter( + self.client.next_serial(), + surface.id, + x.apply_fract(x_int), + y.apply_fract(y_int), + ); + } + } Ok(()) }