From 5a996b6f088db3cb6f7b1bbc8db151eb6b11dd8d Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 23 Nov 2024 15:26:55 +0300 Subject: [PATCH] Add some missing time updates --- src/handlers/compositor.rs | 5 ++++- src/handlers/xdg_shell.rs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs index ceb22b780..28437d9d2 100644 --- a/src/handlers/compositor.rs +++ b/src/handlers/compositor.rs @@ -19,8 +19,8 @@ use smithay::{delegate_compositor, delegate_shm}; use super::xdg_shell::add_mapped_toplevel_pre_commit_hook; use crate::niri::{ClientState, State}; -use crate::utils::send_scale_transform; use crate::utils::transaction::Transaction; +use crate::utils::{get_monotonic_time, send_scale_transform}; use crate::window::{InitialConfigureState, Mapped, ResolvedWindowRules, Unmapped}; impl CompositorHandler for State { @@ -72,6 +72,9 @@ impl CompositorHandler for State { .root_surface .insert(surface.clone(), root_surface.clone()); + // We might be about to start some animations, need up-to-date time. + self.niri.advance_animations(get_monotonic_time()); + if surface == &root_surface { // This is a root surface commit. It might have mapped a previously-unmapped toplevel. if let Entry::Occupied(entry) = self.niri.unmapped_windows.entry(surface.clone()) { diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index 0ac82d799..bbd604461 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -577,6 +577,9 @@ impl XdgShellHandler for State { return; } + // We're about to start some animations on the layout, need up-to-date time. + self.niri.advance_animations(get_monotonic_time()); + let win_out = self .niri .layout