fix: prevent navigation and focus issues by checking route state#922
Conversation
937db2a to
942fc52
Compare
|
@PartyDonut seeing this issue #930, do you think this would also make sense as a change in the player? If the player is fullscreen, when the user first hits Escape it takes them out of fullscreen, and if they hit Escape again it stops the player. Currently when a player hits Escape once while fullscreen it goes out of fullscreen and stops the player, so I thought adding the above change would help. |
This is the other way around right? Or at least for me it closes the player first and hitting escape again exits full-screen (on macOS). This might actually depend on this system in which case the default "escape" shortcut should probably be changed? How it works now from the PR is probably better close the player first and then let the system take over exiting full-screen. |
Pull Request Description
This pull request improves the handling of focus and exit actions in the video player and input handler components by ensuring that certain actions only occur when the current route is active. This helps prevent unintended behavior when the widget is not the topmost route.
Route-awareness improvements:
_TvPlayerControlsState(tv_player_controls.dart) and_DesktopControlsState(video_player_controls.dart), the exit hotkey now checks if the current route is active before closing the player, preventing accidental closure when not on the main route._InputHandlerState(input_handler.dart), autofocus is now only triggered if the current route is active, avoiding unwanted focus changes when the widget is not visible.As an example, when going into one of the sub-menus while in the player, such as
SubtitlesorAudio, you can pressEscapeto go back to the player without actually exiting the player. If you are in the player itself it will then stop the player.Issue Being Fixed
Resolves #694
Screenshots / Recordings
Tested On
Checklist