Implement window resize animations

This commit is contained in:
Ivan Molodetskikh
2024-04-13 11:07:23 +04:00
parent 4fd9300bdb
commit 71be19b234
21 changed files with 1433 additions and 89 deletions
+13 -3
View File
@@ -2,7 +2,9 @@ use std::cell::RefCell;
use std::cmp::{max, min};
use std::rc::Rc;
use niri::layout::{LayoutElement, LayoutElementRenderElement, LayoutElementRenderSnapshot};
use niri::layout::{
AnimationSnapshot, LayoutElement, LayoutElementRenderElement, LayoutElementRenderSnapshot,
};
use niri::render_helpers::renderer::NiriRenderer;
use niri::render_helpers::{RenderSnapshot, RenderTarget};
use niri::window::ResolvedWindowRules;
@@ -177,7 +179,7 @@ impl LayoutElement for TestWindow {
RenderSnapshot::default()
}
fn request_size(&self, size: Size<i32, Logical>) {
fn request_size(&mut self, size: Size<i32, Logical>, _animate: bool) {
self.inner.borrow_mut().requested_size = Some(size);
self.inner.borrow_mut().pending_fullscreen = false;
}
@@ -214,7 +216,7 @@ impl LayoutElement for TestWindow {
fn set_bounds(&self, _bounds: Size<i32, Logical>) {}
fn send_pending_configure(&self) {}
fn send_pending_configure(&mut self) {}
fn is_fullscreen(&self) -> bool {
false
@@ -230,4 +232,12 @@ impl LayoutElement for TestWindow {
static EMPTY: ResolvedWindowRules = ResolvedWindowRules::empty();
&EMPTY
}
fn animation_snapshot(&self) -> Option<&AnimationSnapshot> {
None
}
fn take_animation_snapshot(&mut self) -> Option<AnimationSnapshot> {
None
}
}