Skip to content

Commit

Permalink
Add some missing time updates
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Nov 23, 2024
1 parent 41a8851 commit 5a996b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/handlers/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()) {
Expand Down
3 changes: 3 additions & 0 deletions src/handlers/xdg_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a996b6

Please sign in to comment.