image-copy: Only embed cursor in toplevel capture if focused

This commit is contained in:
Ian Douglas Scott 2026-07-14 16:52:14 -07:00 committed by Victoria Brekenfeld
parent 270ba7bf80
commit d7d6be3cdb

View file

@ -614,6 +614,11 @@ pub fn render_window_to_buffer(
let pointer_loc = pointer.current_location().to_i32_round().as_global(); let pointer_loc = pointer.current_location().to_i32_round().as_global();
let mut location = None; let mut location = None;
if let Some(element) = shell.element_for_surface(toplevel) if let Some(element) = shell.element_for_surface(toplevel)
&& pointer
.current_focus()
.and_then(|f| f.toplevel(&shell))
.as_ref()
== Some(toplevel)
&& element.has_active_window(toplevel) && element.has_active_window(toplevel)
&& let Some(workspace) = shell.space_for(element) && let Some(workspace) = shell.space_for(element)
&& let Some(geometry) = workspace.element_geometry(element) && let Some(geometry) = workspace.element_geometry(element)