From 7a50625e78d519b64078b640ebb995a534915c62 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 28 May 2026 13:11:14 -0700 Subject: [PATCH] image-copy: Fix cursor pos for toplevels with SSD --- src/shell/focus/target.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/shell/focus/target.rs b/src/shell/focus/target.rs index b606dc17..e0d10662 100644 --- a/src/shell/focus/target.rs +++ b/src/shell/focus/target.rs @@ -241,12 +241,17 @@ impl PointerFocusTarget { return; } - let cursor_pos = Some( - event - .location - .to_buffer(1.0, Transform::Normal, &toplevel.geometry().size.to_f64()) - .to_i32_round(), - ); + let cursor_pos = if let Some(_wl_surface) = self.wl_surface() { + Some( + event + .location + .to_buffer(1.0, Transform::Normal, &toplevel.geometry().size.to_f64()) + .to_i32_round(), + ) + } else { + // If cursor is in SSD, instead of a `wl_surface`, it is outside the captured bounds + None + }; let cursor_hotspot = if let Some((_, hotspot)) = seat.cursor_geometry((0.0, 0.0), Duration::from_millis(event.time as u64).into())