event loop: Explicitly schedule frames for slow animations again
This commit is contained in:
parent
13be507093
commit
4dbaa58483
1 changed files with 42 additions and 2 deletions
44
src/main.rs
44
src/main.rs
|
|
@ -13,8 +13,12 @@ use std::{env, ffi::OsString, process, sync::Arc};
|
|||
use tracing::{error, info, warn};
|
||||
|
||||
use crate::{
|
||||
state::BackendData, utils::prelude::SeatExt,
|
||||
wayland::handlers::compositor::client_compositor_state,
|
||||
state::BackendData,
|
||||
utils::prelude::SeatExt,
|
||||
wayland::{
|
||||
handlers::{compositor::client_compositor_state, screencopy::PendingScreencopyBuffers},
|
||||
protocols::screencopy::SessionType,
|
||||
},
|
||||
};
|
||||
|
||||
pub mod backend;
|
||||
|
|
@ -97,6 +101,42 @@ fn main() -> Result<()> {
|
|||
state.common.shell.refresh();
|
||||
state::Common::refresh_focus(state);
|
||||
|
||||
if state.common.shell.animations_going() {
|
||||
for output in state
|
||||
.common
|
||||
.shell
|
||||
.outputs()
|
||||
.cloned()
|
||||
.collect::<Vec<_>>()
|
||||
.into_iter()
|
||||
{
|
||||
let mut scheduled_sessions = state.workspace_session_for_output(&output);
|
||||
if let Some(sessions) = output.user_data().get::<PendingScreencopyBuffers>() {
|
||||
scheduled_sessions
|
||||
.get_or_insert_with(Vec::new)
|
||||
.extend(sessions.borrow_mut().drain(..));
|
||||
}
|
||||
state.backend.schedule_render(
|
||||
&state.common.event_loop_handle,
|
||||
&output,
|
||||
scheduled_sessions.as_ref().map(|sessions| {
|
||||
sessions
|
||||
.iter()
|
||||
.filter(|(s, _)| match s.session_type() {
|
||||
SessionType::Output(o) | SessionType::Workspace(o, _)
|
||||
if o == output =>
|
||||
{
|
||||
true
|
||||
}
|
||||
_ => false,
|
||||
})
|
||||
.cloned()
|
||||
.collect::<Vec<_>>()
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// send out events
|
||||
let _ = state.common.display_handle.flush_clients();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue