Skip to content

Commit 3aad95d

Browse files
committed
screencopy: Capture with full damage
Should accumulate damage, but this will behave correctly, if not optimally. Not yet required with cosmic-comp implementation.
1 parent 7933eef commit 3aad95d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/backend/wayland/screencopy.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use cosmic::{
33
self,
44
screencopy::{
55
CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats,
6-
Frame, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
6+
Frame, Rect, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
77
ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState,
88
},
99
wayland_client::{Connection, QueueHandle, WEnum},
@@ -66,9 +66,18 @@ impl ScreencopySession {
6666
// TODO
6767
// let node = back.node().and_then(|x| x.to_str().map(|x| x.to_string()));
6868

69+
// TODO: accumulate damage
70+
let (width, height) = back.size;
71+
let full_damage = &[Rect {
72+
x: 0,
73+
y: 0,
74+
width: width as i32,
75+
height: height as i32,
76+
}];
77+
6978
self.session.capture(
7079
&back.buffer,
71-
&[],
80+
full_damage,
7281
qh,
7382
FrameData {
7483
frame_data: Default::default(),

0 commit comments

Comments
 (0)