Stop updating focus during transitions
Browse files at this commit8bde252ba4c8f552cc8bcabcd2b277278884781dParent: 29ddd702 changed files +7 -2
- src/layout.rs +5 -0
- src/niri.rs +2 -2
src/layout.rsmodified+5 -0
| @@ -1634,6 +1634,11 @@ impl<W: LayoutElement> Monitor<W> { | |||
| 1634 | || self.workspaces.iter().any(|ws| ws.are_animations_ongoing()) | 1634 | || self.workspaces.iter().any(|ws| ws.are_animations_ongoing()) |
| 1635 | } | 1635 | } |
| 1636 | 1636 | ||
| 1637 | + pub fn are_transitions_ongoing(&self) -> bool { | ||
| 1638 | + self.workspace_switch.is_some() | ||
| 1639 | + || self.workspaces.iter().any(|ws| ws.are_animations_ongoing()) | ||
| 1640 | + } | ||
| 1641 | + | ||
| 1637 | fn update_config(&mut self, options: Rc<Options>) { | 1642 | fn update_config(&mut self, options: Rc<Options>) { |
| 1638 | for ws in &mut self.workspaces { | 1643 | for ws in &mut self.workspaces { |
| 1639 | ws.update_config(options.clone()); | 1644 | ws.update_config(options.clone()); |
src/niri.rsmodified+2 -2
| @@ -275,10 +275,10 @@ impl State { | |||
| 275 | let pointer = &self.niri.seat.get_pointer().unwrap(); | 275 | let pointer = &self.niri.seat.get_pointer().unwrap(); |
| 276 | let location = pointer.current_location(); | 276 | let location = pointer.current_location(); |
| 277 | 277 | ||
| 278 | - // Don't refresh cursor focus during animations. | 278 | + // Don't refresh cursor focus during transitions. |
| 279 | if let Some((output, _)) = self.niri.output_under(location) { | 279 | if let Some((output, _)) = self.niri.output_under(location) { |
| 280 | let monitor = self.niri.layout.monitor_for_output(output).unwrap(); | 280 | let monitor = self.niri.layout.monitor_for_output(output).unwrap(); |
| 281 | - if monitor.are_animations_ongoing() { | 281 | + if monitor.are_transitions_ongoing() { |
| 282 | return; | 282 | return; |
| 283 | } | 283 | } |
| 284 | } | 284 | } |