Call attach_buffer_and_commit before reading front buffer
This way double buffering is somewhat useful; we can start another capture before reading out the buffer.
This commit is contained in:
parent
89910b8e75
commit
6e422b740c
1 changed files with 4 additions and 3 deletions
|
|
@ -150,6 +150,10 @@ impl ScreencopyHandler for AppData {
|
|||
let (front, back) = session.buffers.as_mut().unwrap();
|
||||
mem::swap(front, back);
|
||||
|
||||
// Capture again on damage
|
||||
session.attach_buffer_and_commit(&capture, conn);
|
||||
|
||||
let (front, _) = session.buffers.as_mut().unwrap();
|
||||
let img = unsafe { front.to_image() };
|
||||
let image = CaptureImage { img };
|
||||
match &capture.source {
|
||||
|
|
@ -164,9 +168,6 @@ impl ScreencopyHandler for AppData {
|
|||
));
|
||||
}
|
||||
};
|
||||
|
||||
// Capture again on damage
|
||||
session.attach_buffer_and_commit(&capture, conn);
|
||||
}
|
||||
|
||||
fn failed(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue