Skip to content

Commit 3c70263

Browse files
ids1024Drakulix
authored andcommitted
screencopy: Without draw_cursor, omit dnd icon from toplevel capture
It seems #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...
1 parent d2f73a6 commit 3c70263

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/wayland/handlers/screencopy/render.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -602,17 +602,21 @@ pub fn render_window_to_buffer(
602602
);
603603
}
604604

605-
if let Some(dnd_icon) = get_dnd_icon(&seat) {
606-
elements.extend(
607-
cursor::draw_dnd_icon(
608-
renderer,
609-
&dnd_icon.surface,
610-
(location + dnd_icon.offset.to_f64()).to_i32_round(),
611-
1.0,
612-
)
613-
.into_iter()
614-
.map(WindowCaptureElement::from),
615-
);
605+
// TODO cosmic-workspaces wants to omit, but metadata cursor capture in portal should
606+
// still include dnd surface in window capture buffer?
607+
if draw_cursor {
608+
if let Some(dnd_icon) = get_dnd_icon(&seat) {
609+
elements.extend(
610+
cursor::draw_dnd_icon(
611+
renderer,
612+
&dnd_icon.surface,
613+
(location + dnd_icon.offset.to_f64()).to_i32_round(),
614+
1.0,
615+
)
616+
.into_iter()
617+
.map(WindowCaptureElement::from),
618+
);
619+
}
616620
}
617621
}
618622

0 commit comments

Comments
 (0)