desktop: Pass focus events to the player

This commit is contained in:
Kamil Jarosz 2024-07-08 17:46:22 +02:00 committed by TÖRÖK Attila
parent 9a88496763
commit 599352093c
1 changed files with 6 additions and 0 deletions

View File

@ -235,6 +235,12 @@ impl App {
); );
} }
} }
WindowEvent::Focused(true) => {
self.player.handle_event(PlayerEvent::FocusGained);
}
WindowEvent::Focused(false) => {
self.player.handle_event(PlayerEvent::FocusLost);
}
WindowEvent::MouseInput { button, state, .. } => { WindowEvent::MouseInput { button, state, .. } => {
if self.gui.borrow_mut().is_context_menu_visible() { if self.gui.borrow_mut().is_context_menu_visible() {
return; return;