Keep screencast running through size changes

This commit is contained in:
Ivan Molodetskikh
2024-06-21 11:05:28 +03:00
parent 198b5a502d
commit 589e5a600c
2 changed files with 101 additions and 47 deletions
+12 -3
View File
@@ -3271,9 +3271,18 @@ impl Niri {
continue;
}
if cast.size != size {
debug!("stopping screencast due to output size change");
casts_to_stop.push(cast.session_id);
if cast.size.get() != size {
if cast.pending_size.get() != size {
debug!("output size changed, updating stream size");
if let Err(err) = cast.set_size(size) {
warn!("error updating stream size, stopping screencast: {err:?}");
casts_to_stop.push(cast.session_id);
}
} else {
debug!("stream size still hasn't changed, skipping frame");
}
// Even in the successful case, we'll need to wait till the size actually changes.
continue;
}