Fixes for screencopy behavior
This commit is contained in:
parent
a26e28c889
commit
2cbef636a4
1 changed files with 8 additions and 0 deletions
|
|
@ -299,6 +299,12 @@ impl ScreencopyHandler for AppData {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let buf_len = buffer_info.stride * buffer_info.height;
|
let buf_len = buffer_info.stride * buffer_info.height;
|
||||||
|
|
||||||
|
// XXX fix in compositor
|
||||||
|
if buffer_info.width == 0 || buffer_info.height == 0 {
|
||||||
|
session.destroy();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: reuse pool? swapping?
|
// TODO: reuse pool? swapping?
|
||||||
let mut pool = RawPool::new(buf_len as usize, &self.shm_state).unwrap();
|
let mut pool = RawPool::new(buf_len as usize, &self.shm_state).unwrap();
|
||||||
let buffer = pool.create_buffer(
|
let buffer = pool.create_buffer(
|
||||||
|
|
@ -343,6 +349,7 @@ impl ScreencopyHandler for AppData {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
self.send_event(event);
|
self.send_event(event);
|
||||||
|
session.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn failed(
|
fn failed(
|
||||||
|
|
@ -354,6 +361,7 @@ impl ScreencopyHandler for AppData {
|
||||||
) {
|
) {
|
||||||
// TODO
|
// TODO
|
||||||
println!("Failed");
|
println!("Failed");
|
||||||
|
session.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue