Skip to content

Commit

Permalink
Cleanup for #2395
Browse files Browse the repository at this point in the history
  • Loading branch information
lhc70000 committed Apr 2, 2019
1 parent 0a27c14 commit dcc346f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
7 changes: 3 additions & 4 deletions iina/MPVController.swift
Expand Up @@ -1079,10 +1079,9 @@ fileprivate func mpvGetOpenGLFunc(_ ctx: UnsafeMutableRawPointer?, _ name: Unsaf
}

fileprivate func mpvUpdateCallback(_ ctx: UnsafeMutableRawPointer?) {
let layer = unsafeBitCast(ctx, to: ViewLayer.self)
if layer.blocked {
return
}
let layer = bridge(ptr: ctx!) as ViewLayer
guard !layer.blocked else { return }

layer.mpvGLQueue.async {
layer.draw()
}
Expand Down
14 changes: 5 additions & 9 deletions iina/MainWindowController.swift
Expand Up @@ -1384,11 +1384,9 @@ class MainWindowController: NSWindowController, NSWindowDelegate {
titleTextField?.alphaValue = 1
removeStandardButtonsFromFadeableViews()

for (_, constraint) in self.videoViewConstraints {
constraint.constant = 0
}
self.videoView.needsLayout = true
self.videoView.layoutSubtreeIfNeeded()
videoViewConstraints.values.forEach { $0.constant = 0 }
videoView.needsLayout = true
videoView.layoutSubtreeIfNeeded()
videoView.videoLayer.resume()

if Preference.bool(for: .blackOutMonitor) {
Expand Down Expand Up @@ -1433,7 +1431,7 @@ class MainWindowController: NSWindowController, NSWindowDelegate {
fsState.startAnimatingToWindow()

videoView.videoLayer.suspend()
self.player.mpv.setFlag(MPVOption.Window.keepaspect, false)
player.mpv.setFlag(MPVOption.Window.keepaspect, false)
}

func windowDidExitFullScreen(_ notification: Notification) {
Expand All @@ -1444,9 +1442,7 @@ class MainWindowController: NSWindowController, NSWindowDelegate {
titleBarView.isHidden = false
showUI()

for (_, constraint) in self.videoViewConstraints {
constraint.constant = 0
}
videoViewConstraints.values.forEach { $0.constant = 0 }
videoView.needsLayout = true
videoView.layoutSubtreeIfNeeded()
videoView.videoLayer.resume()
Expand Down

0 comments on commit dcc346f

Please sign in to comment.