fix(macos): restore traffic lights on player exit
This commit is contained in:
@@ -249,10 +249,12 @@ extension _PlexVideoControlsVisibilityMethods on _PlexVideoControlsState {
|
||||
}
|
||||
|
||||
void _updateTrafficLightVisibility() async {
|
||||
final generation = ++_trafficLightVisibilityGeneration;
|
||||
// When maximized or fullscreen, always keep traffic lights visible so the
|
||||
// user can reach them without the controls-hide-on-mouse-leave race.
|
||||
// In normal windowed mode, toggle with controls as before.
|
||||
final isMaximizedOrFullscreen = await windowManager.isMaximized() || await windowManager.isFullScreen();
|
||||
if (!mounted || generation != _trafficLightVisibilityGeneration) return;
|
||||
final visible = isMaximizedOrFullscreen || _forceShowControls ? true : _showControls;
|
||||
await MacOSWindowService.setTrafficLightsVisible(visible);
|
||||
}
|
||||
|
||||
@@ -362,6 +362,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
Timer? _lockIconTimer;
|
||||
bool get _clickVideoTogglesPlayback => _settings.read(SettingsService.clickVideoTogglesPlayback);
|
||||
bool _isContentStripVisible = false; // Whether the swipe-up content strip is showing
|
||||
int _trafficLightVisibilityGeneration = 0;
|
||||
|
||||
// GlobalKey to access DesktopVideoControls state for focus management
|
||||
final GlobalKey<DesktopVideoControlsState> _desktopControlsKey = GlobalKey<DesktopVideoControlsState>();
|
||||
@@ -524,6 +525,8 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
}
|
||||
if (Platform.isMacOS) {
|
||||
_pipService.isPipActive.removeListener(_onMacPipChanged);
|
||||
_trafficLightVisibilityGeneration++;
|
||||
unawaited(MacOSWindowService.setTrafficLightsVisible(true));
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user