screencopy: Capture with full damage
Should accumulate damage, but this will behave correctly, if not optimally. Not yet required with cosmic-comp implementation.
This commit is contained in:
parent
7933eef149
commit
3aad95d463
1 changed files with 11 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ use cosmic::{
|
||||||
self,
|
self,
|
||||||
screencopy::{
|
screencopy::{
|
||||||
CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats,
|
CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats,
|
||||||
Frame, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
|
Frame, Rect, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
|
||||||
ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState,
|
ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState,
|
||||||
},
|
},
|
||||||
wayland_client::{Connection, QueueHandle, WEnum},
|
wayland_client::{Connection, QueueHandle, WEnum},
|
||||||
|
|
@ -66,9 +66,18 @@ impl ScreencopySession {
|
||||||
// TODO
|
// TODO
|
||||||
// let node = back.node().and_then(|x| x.to_str().map(|x| x.to_string()));
|
// let node = back.node().and_then(|x| x.to_str().map(|x| x.to_string()));
|
||||||
|
|
||||||
|
// TODO: accumulate damage
|
||||||
|
let (width, height) = back.size;
|
||||||
|
let full_damage = &[Rect {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: width as i32,
|
||||||
|
height: height as i32,
|
||||||
|
}];
|
||||||
|
|
||||||
self.session.capture(
|
self.session.capture(
|
||||||
&back.buffer,
|
&back.buffer,
|
||||||
&[],
|
full_damage,
|
||||||
qh,
|
qh,
|
||||||
FrameData {
|
FrameData {
|
||||||
frame_data: Default::default(),
|
frame_data: Default::default(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue