diff --git a/video/out/cocoa/mpvadapter.h b/video/out/cocoa/mpvadapter.h index 65832aeae5..b5fa8adbf4 100644 --- a/video/out/cocoa/mpvadapter.h +++ b/video/out/cocoa/mpvadapter.h @@ -28,6 +28,7 @@ - (void)handleFilesArray:(NSArray *)files; - (void)didChangeWindowedScreenProfile:(NSNotification *)notification; - (void)performAsyncResize:(NSSize)size; +- (void)windowDidChangePhysicalScreen; - (BOOL)isInFullScreenMode; - (BOOL)keyboardEnabled; diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m index 028b17985f..88b1596d40 100644 --- a/video/out/cocoa/window.m +++ b/video/out/cocoa/window.m @@ -168,14 +168,15 @@ - (void)windowDidChangeScreen:(NSNotification *)notification { - //this event doesn't exclusively trigger on screen change - //examples: screen reconfigure, toggling fullscreen + [self.adapter windowDidChangeScreen:notification]; + if (!_is_animating && ![[self currentScreen] isEqual:[self screen]]) { self.previousScreen = [self screen]; } if (![[self currentScreen] isEqual:[self screen]]) { - [self.adapter windowDidChangeScreen:notification]; + [self.adapter windowDidChangePhysicalScreen]; } + self.currentScreen = [self screen]; } diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index f59ffd9005..e3f359eb5c 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -1018,6 +1018,10 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) - (void)windowDidChangeScreen:(NSNotification *)notification { vo_cocoa_update_screen_info(self.vout); +} + +- (void)windowDidChangePhysicalScreen +{ vo_cocoa_update_displaylink(self.vout); flag_events(self.vout, VO_EVENT_WIN_STATE); }