diff options
author | Akemi <der.richter@gmx.de> | 2018-02-22 23:56:49 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-25 22:07:33 -0800 |
commit | 4d6601924a4d2df557f78f3192236d84f7a4274e (patch) | |
tree | e7d23ec5c041219cf716b7c5fb5f7e99bcc18bab /video/out/cocoa_cb_common.swift | |
parent | 7fff1b6c10e53ba3139eb06a2598d1587c969741 (diff) | |
download | mpv-4d6601924a4d2df557f78f3192236d84f7a4274e.tar.bz2 mpv-4d6601924a4d2df557f78f3192236d84f7a4274e.tar.xz |
cocoa-cb: fix wrong fullscreen window size
even though the fullscreen animation has a shorter duration than the
system wide animation (space sliding effect) there are still cases where
it takes longer, eg performance issues (especially on init). furthermore
the final size of the animation is usually different than the actual
fullscreen size because of spect ratio differences. the actual resize to
fullscreen is done automatically by cocoa itself when the actual
transition to fullscreen happens (system event). so it could happen that
the last animation resize happened after the actual resize to fullscreen
leading to a wrongly sized frame after entering fullscreen. to prevent
this we cancel the animation when entering fullscreen, we always set the
proper frame size when in fullscreen and discard any other frame sizes,
and to prevent some performance problems on init we push entering
fullscreen to the end of the main queue to execute it when most of the
init routines are done.
Fixes #5525
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r-- | video/out/cocoa_cb_common.swift | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift index 0ce06428bd..cd43195a3e 100644 --- a/video/out/cocoa_cb_common.swift +++ b/video/out/cocoa_cb_common.swift @@ -114,7 +114,9 @@ class CocoaCB: NSObject { layer.setVideo(true) if self.mpv.getBoolProperty("fullscreen") { - window.toggleFullScreen(nil) + DispatchQueue.main.async { + self.window.toggleFullScreen(nil) + } } else { window.isMovableByWindowBackground = true } |