screencopy: Without draw_cursor, omit dnd icon from toplevel capture

It seems https://github.com/pop-os/cosmic-comp/pull/1638 caused an issue
in cosmic-workspaces, where if there are multiple toplevels, when
dragging a toplevel, the drag surface would appear in capture for other
toplevels.

For now, omit drag surface in toplevel capture without `draw_cursor`.
Though I guess ultimately we do want it for metadata cursor capture in
the portal, but not in cosmic-workspaces? Maybe the protocol needs some
additional option for this...
This commit is contained in:
Ian Douglas Scott 2025-10-01 09:43:40 -07:00 committed by Victoria Brekenfeld
parent d2f73a6d6c
commit 3c70263e0f

View file

@ -602,6 +602,9 @@ pub fn render_window_to_buffer(
); );
} }
// TODO cosmic-workspaces wants to omit, but metadata cursor capture in portal should
// still include dnd surface in window capture buffer?
if draw_cursor {
if let Some(dnd_icon) = get_dnd_icon(&seat) { if let Some(dnd_icon) = get_dnd_icon(&seat) {
elements.extend( elements.extend(
cursor::draw_dnd_icon( cursor::draw_dnd_icon(
@ -615,6 +618,7 @@ pub fn render_window_to_buffer(
); );
} }
} }
}
elements.extend(AsRenderElements::<R>::render_elements::< elements.extend(AsRenderElements::<R>::render_elements::<
WindowCaptureElement<R>, WindowCaptureElement<R>,