diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-01-01 14:38:08 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-01-01 14:38:08 +0100 |
commit | 64b6b2ea458f679ec0370878b1e54b2b1822c4b1 (patch) | |
tree | 0e694a2818886a6654f4ddf2b42af937d997214b /video/out/cocoa | |
parent | 39548ad9e961794e023aef0e281089064dd41f36 (diff) | |
download | mpv-64b6b2ea458f679ec0370878b1e54b2b1822c4b1.tar.bz2 mpv-64b6b2ea458f679ec0370878b1e54b2b1822c4b1.tar.xz |
cocoa: fix uninitialization while in fullscreen
This is only needed for switching video track with `_`, since Cocoa
automatically handles cleaning up the application's presentation options when
quitting the process.
Fixes #1399
Diffstat (limited to 'video/out/cocoa')
-rw-r--r-- | video/out/cocoa/events_view.h | 1 | ||||
-rw-r--r-- | video/out/cocoa/events_view.m | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/video/out/cocoa/events_view.h b/video/out/cocoa/events_view.h index ff2500a7bc..a16a2d7d5a 100644 --- a/video/out/cocoa/events_view.h +++ b/video/out/cocoa/events_view.h @@ -21,5 +21,6 @@ @interface MpvEventsView : NSView <NSDraggingDestination> @property(nonatomic, retain) MpvCocoaAdapter *adapter; - (void)setFullScreen:(BOOL)willBeFullscreen; +- (void)clear; - (BOOL)canHideCursor; @end diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m index 8e96ac1244..2833bf2773 100644 --- a/video/out/cocoa/events_view.m +++ b/video/out/cocoa/events_view.m @@ -25,6 +25,7 @@ #include "events_view.h" @interface MpvEventsView() +@property(nonatomic, assign) BOOL clearing; @property(nonatomic, assign) BOOL hasMouseDown; @property(nonatomic, retain) NSTrackingArea *tracker; - (void)signalMousePosition; @@ -36,6 +37,7 @@ @end @implementation MpvEventsView +@synthesize clearing = _clearing; @synthesize adapter = _adapter; @synthesize tracker = _tracker; @synthesize hasMouseDown = _mouse_down; @@ -90,6 +92,12 @@ } } +- (void)clear +{ + self.clearing = YES; + [self exitFullScreenModeWithOptions:nil]; +} + // mpv uses flipped coordinates, because X11 uses those. So let's just use them // as well without having to do any coordinate conversion of mouse positions. - (BOOL)isFlipped { return YES; } @@ -177,6 +185,10 @@ - (void)setFrameSize:(NSSize)size { [super setFrameSize:size]; + + if (self.clearing) + return; + [self signalMousePosition]; } |