diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-23 15:41:06 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-23 15:41:06 +0300 |
| commit | c8839f7658588bfd7f0f41bf2c2726e526366abf (patch) | |
| tree | 99a2efd437d61d2b1eeda7b96bc68aa940716ef6 /src/handlers/compositor.rs | |
| parent | dfe3580607ff469837c23b34db34882b16d87a47 (diff) | |
| download | niri-c8839f7658588bfd7f0f41bf2c2726e526366abf.tar.gz niri-c8839f7658588bfd7f0f41bf2c2726e526366abf.tar.bz2 niri-c8839f7658588bfd7f0f41bf2c2726e526366abf.zip | |
Implement window close transaction
Mainly visible with disabled animations.
Diffstat (limited to 'src/handlers/compositor.rs')
| -rw-r--r-- | src/handlers/compositor.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs index e833494c..9614883d 100644 --- a/src/handlers/compositor.rs +++ b/src/handlers/compositor.rs @@ -20,6 +20,7 @@ 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::window::{InitialConfigureState, Mapped, ResolvedWindowRules, Unmapped}; impl CompositorHandler for State { @@ -193,11 +194,13 @@ impl CompositorHandler for State { }); // Must start the close animation before window.on_commit(). + let transaction = Transaction::new(); if !is_mapped { + let blocker = transaction.blocker(); self.backend.with_primary_renderer(|renderer| { self.niri .layout - .start_close_animation_for_window(renderer, &window); + .start_close_animation_for_window(renderer, &window, blocker); }); } @@ -216,7 +219,7 @@ impl CompositorHandler for State { id: u64::from(id.get()), }); - self.niri.layout.remove_window(&window); + self.niri.layout.remove_window(&window, transaction); self.add_default_dmabuf_pre_commit_hook(surface); if was_active { |
