aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-15 10:30:32 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-30 20:12:37 +0300
commit9c205f77a2c224e336f3e5222c4d5865d7674cf0 (patch)
treee0e04a950739d65ed49ec089f9889d5829128d89
parentc2e4cfd832953a9974572e3e1805bfbe4c3375ef (diff)
downloadniri-9c205f77a2c224e336f3e5222c4d5865d7674cf0.tar.gz
niri-9c205f77a2c224e336f3e5222c4d5865d7674cf0.tar.bz2
niri-9c205f77a2c224e336f3e5222c4d5865d7674cf0.zip
layout/floating: Move a function higher up
Let's group action functions together. Activate is an action and set width/height too.
-rw-r--r--src/layout/floating.rs40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/layout/floating.rs b/src/layout/floating.rs
index cb2aaafb..c18cb646 100644
--- a/src/layout/floating.rs
+++ b/src/layout/floating.rs
@@ -482,6 +482,26 @@ impl<W: LayoutElement> FloatingSpace<W> {
}
}
+ pub fn start_close_animation_for_window(
+ &mut self,
+ renderer: &mut GlesRenderer,
+ id: &W::Id,
+ blocker: TransactionBlocker,
+ ) {
+ let (tile, tile_pos) = self
+ .tiles_with_render_positions_mut(false)
+ .find(|(tile, _)| tile.window().id() == id)
+ .unwrap();
+
+ let Some(snapshot) = tile.take_unmap_snapshot() else {
+ return;
+ };
+
+ let tile_size = tile.tile_size();
+
+ self.start_close_animation_for_tile(renderer, snapshot, tile_size, tile_pos, blocker);
+ }
+
pub fn activate_window_without_raising(&mut self, id: &W::Id) -> bool {
if !self.contains(id) {
return false;
@@ -512,26 +532,6 @@ impl<W: LayoutElement> FloatingSpace<W> {
self.data.insert(to_idx, data);
}
- pub fn start_close_animation_for_window(
- &mut self,
- renderer: &mut GlesRenderer,
- id: &W::Id,
- blocker: TransactionBlocker,
- ) {
- let (tile, tile_pos) = self
- .tiles_with_render_positions_mut(false)
- .find(|(tile, _)| tile.window().id() == id)
- .unwrap();
-
- let Some(snapshot) = tile.take_unmap_snapshot() else {
- return;
- };
-
- let tile_size = tile.tile_size();
-
- self.start_close_animation_for_tile(renderer, snapshot, tile_size, tile_pos, blocker);
- }
-
pub fn start_close_animation_for_tile(
&mut self,
renderer: &mut GlesRenderer,