Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Fix fullscreen only works for first video, iina#4202
Browse files Browse the repository at this point in the history
This commit will:
- Remove a check in `PlayerCore.fileLoaded` that only put the player
  into full screen mode for the first file
- Remove the property `justLaunched` from `PlaybackInfo`

This causes the "Enter fullscreen" setting under the "When media is
opened" settings to when enabled put the player into full screen mode
for all videos, not just the first video played.
  • Loading branch information
low-batt authored and CarterLi committed Mar 1, 2023
1 parent 8b832e6 commit fa24401
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion iina/PlaybackInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class PlaybackInfo {
}
}

var justLaunched: Bool = true
var justStartedFile: Bool = false
var justOpenedFile: Bool = false
var shouldAutoLoadFiles: Bool = false
Expand Down
8 changes: 2 additions & 6 deletions iina/PlayerCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1381,12 +1381,8 @@ class PlayerCore: NSObject {
miniPlayer.defaultAlbumArt.isHidden = self.info.vid != 0
}
}
// set initial properties for the first file
if info.justLaunched {
if Preference.bool(for: .fullScreenWhenOpen) && !mainWindow.fsState.isFullscreen && !isInMiniPlayer {
DispatchQueue.main.async(execute: self.mainWindow.toggleWindowFullScreen)
}
info.justLaunched = false
if Preference.bool(for: .fullScreenWhenOpen) && !mainWindow.fsState.isFullscreen && !isInMiniPlayer {
DispatchQueue.main.async(execute: self.mainWindow.toggleWindowFullScreen)
}
// add to history
if let url = info.currentURL {
Expand Down

0 comments on commit fa24401

Please sign in to comment.