cocoa-cb: fix side by side Split View

when entering a Split View a windowDidEnterFullScreen event happens
without a previous toggleFullScreen call. in that case it tries to stop
an animation that was never initiated by us and basically breaks the
system initiated fullscreen, or in this case the Split View. immediately
after entering the fullscreen it tries top stop the animation and
resizes the window, which causes the window to exit fullscreen. only
try to stop an animation that was initiated by us and is safe to stop.
This commit is contained in:
Akemi 2018-06-15 12:49:09 +02:00 committed by Jan Ekström
parent 1842a932d3
commit 2b0b9bb6a1
1 changed files with 1 additions and 1 deletions

View File

@ -309,7 +309,7 @@ class Window: NSWindow, NSWindowDelegate {
}
func endAnimation(_ newFrame: NSRect = NSZeroRect) {
if !NSEqualRects(newFrame, NSZeroRect) {
if !NSEqualRects(newFrame, NSZeroRect) && isAnimating {
NSAnimationContext.runAnimationGroup({ (context) -> Void in
context.duration = 0.01
self.animator().setFrame(newFrame, display: true)