Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stretched screen when entering and exiting fullscreen #2395

Merged
merged 2 commits into from Apr 2, 2019

Conversation

3 participants
@alejx
Copy link
Member

alejx commented Apr 1, 2019

  • This change has been discussed with the author.
  • It implements / fixes issue #.

alejx added some commits Apr 1, 2019

Remove redraw code for stationary pictures
Since every animation conducts a force draw now

@alejx alejx requested review from lhc70000, HarukaMa and saagarjha and removed request for lhc70000 Apr 1, 2019

@lhc70000 lhc70000 merged commit 0a27c14 into develop Apr 2, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@lhc70000 lhc70000 deleted the fix-stretched-screen branch Apr 2, 2019

@saagarjha
Copy link
Member

saagarjha left a comment

Not completely sure what this fixes, but here's what I've got.

@@ -1080,6 +1080,9 @@ fileprivate func mpvGetOpenGLFunc(_ ctx: UnsafeMutableRawPointer?, _ name: Unsaf

fileprivate func mpvUpdateCallback(_ ctx: UnsafeMutableRawPointer?) {
let layer = unsafeBitCast(ctx, to: ViewLayer.self)

This comment has been minimized.

Copy link
@saagarjha

saagarjha Apr 2, 2019

Member

This isn't part of your changes, but I feel like unsafeBitCast(_:to:) is incorrect here. Perhaps this should use UnsafeMutableRawPointer.assumingMemoryBound(to:)?

@@ -1080,6 +1080,9 @@ fileprivate func mpvGetOpenGLFunc(_ ctx: UnsafeMutableRawPointer?, _ name: Unsaf

fileprivate func mpvUpdateCallback(_ ctx: UnsafeMutableRawPointer?) {
let layer = unsafeBitCast(ctx, to: ViewLayer.self)
if layer.blocked {

This comment has been minimized.

Copy link
@saagarjha

saagarjha Apr 2, 2019

Member

I'd use a guard here.

self.videoView.layoutSubtreeIfNeeded()
self.videoView.videoLayer.draw()
}
for (_, constraint) in self.videoViewConstraints {

This comment has been minimized.

Copy link
@saagarjha

saagarjha Apr 2, 2019

Member

for constraint in self.videoViewConstraints.values

lhc70000 added a commit that referenced this pull request Apr 2, 2019

@lhc70000

This comment has been minimized.

Copy link
Member

lhc70000 commented Apr 2, 2019

@saagarjha

Fixed in dcc346f. An unmanaged reference of the VideoLayer was passed to mpv as the context, so here we should also use Unmanaged to load the pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.