aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-04-10 08:53:35 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-04-10 09:14:04 +0400
commit18886965673e3f9d5faec0bafd09f68be2d9db45 (patch)
tree4cfc7fbf7c5b9b87fca7c47e672a6c47cc06855a /src/niri.rs
parentb9e789619f91d4b542618cb19b0fa27cd2e052c7 (diff)
downloadniri-18886965673e3f9d5faec0bafd09f68be2d9db45.tar.gz
niri-18886965673e3f9d5faec0bafd09f68be2d9db45.tar.bz2
niri-18886965673e3f9d5faec0bafd09f68be2d9db45.zip
Reimplement window closing anim in an efficient way
- Keep a root surface cache to be accessible in surface destroyed() - Only snapshot during / right before closing, rather than every frame - Store textures rather than elements to handle scale and alpha properly
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 1eedcffa..f14f7dcd 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -151,6 +151,10 @@ pub struct Niri {
// Windows which don't have a buffer attached yet.
pub unmapped_windows: HashMap<WlSurface, Unmapped>,
+ // Cached root surface for every surface, so that we can access it in destroyed() where the
+ // normal get_parent() is cleared out.
+ pub root_surface: HashMap<WlSurface, WlSurface>,
+
pub output_state: HashMap<Output, OutputState>,
pub output_by_name: HashMap<String, Output>,
@@ -1318,6 +1322,7 @@ impl Niri {
output_state: HashMap::new(),
output_by_name: HashMap::new(),
unmapped_windows: HashMap::new(),
+ root_surface: HashMap::new(),
monitors_active: true,
devices: HashSet::new(),