diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/input.rs | 7 | ||||
| -rw-r--r-- | src/layout.rs | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs index 9e7267a9..2f442c34 100644 --- a/src/input.rs +++ b/src/input.rs @@ -9,6 +9,7 @@ use smithay::input::pointer::{AxisFrame, ButtonEvent, MotionEvent, RelativeMotio use smithay::utils::SERIAL_COUNTER; use crate::niri::Niri; +use crate::utils::get_monotonic_time; enum Action { None, @@ -101,6 +102,12 @@ impl Niri { let _span = tracy_client::span!("process_input_event"); trace!("process_input_event"); + // A bit of a hack, but animation end runs some logic (i.e. workspace clean-up) and it + // doesn't always trigger due to damage, etc. So run it here right before it might prove + // important. Besides, animations affect the input, so it's best to have up-to-date values + // here. + self.monitor_set.advance_animations(get_monotonic_time()); + match event { InputEvent::Keyboard { event, .. } => { let serial = SERIAL_COUNTER.next_serial(); diff --git a/src/layout.rs b/src/layout.rs index 542c43b4..618f6fe0 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -726,6 +726,21 @@ impl<W: LayoutElement> MonitorSet<W> { } } } + + pub fn advance_animations(&mut self, current_time: Duration) { + match self { + MonitorSet::Normal { monitors, .. } => { + for mon in monitors { + mon.advance_animations(current_time); + } + } + MonitorSet::NoOutputs(workspaces) => { + for ws in workspaces { + ws.advance_animations(current_time); + } + } + } + } } impl MonitorSet<Window> { |
