Skip to content
Permalink
Browse files

Cleanup for #2395

  • Loading branch information...
lhc70000 committed Apr 2, 2019
1 parent 0a27c14 commit dcc346f8a3ace104dfac7f75c7fc1fe14f5a2539
Showing with 8 additions and 13 deletions.
  1. +3 −4 iina/MPVController.swift
  2. +5 −9 iina/MainWindowController.swift
@@ -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()
}
@@ -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) {
@@ -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) {
@@ -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()

0 comments on commit dcc346f

Please sign in to comment.
You can’t perform that action at this time.