[vlc-commits] macosx: correctly hide the cursor when using Lion's native fullscreen mode. Fixes #5327
Felix Paul Kühne
git at videolan.org
Sat Oct 15 17:17:00 CEST 2011
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Oct 15 17:16:55 2011 +0200| [2c1424825a7b6c0f18f9a7b594a70fef202cf5c3] | committer: Felix Paul Kühne
macosx: correctly hide the cursor when using Lion's native fullscreen mode. Fixes #5327
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c1424825a7b6c0f18f9a7b594a70fef202cf5c3
---
modules/gui/macosx/CompatibilityFixes.h | 2 ++
modules/gui/macosx/MainWindow.h | 4 ++++
modules/gui/macosx/MainWindow.m | 12 ++++++++++++
3 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
index b27566c..8fd8b6a 100644
--- a/modules/gui/macosx/CompatibilityFixes.h
+++ b/modules/gui/macosx/CompatibilityFixes.h
@@ -77,6 +77,8 @@ enum {
@interface NSWindow (IntroducedInLion)
- (void)setRestorable:(BOOL)b_value;
- (void)toggleFullScreen:(id)id_value;
+- (void)windowWillEnterFullScreen:(NSNotification *)notification;
+- (void)windowWillExitFullScreen:(NSNotification *)notification;
@end
@interface NSEvent (IntroducedInLion)
diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index 396f242..a1668e3 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -160,6 +160,10 @@
- (void)hasBecomeFullscreen;
- (void)setFrameOnMainThread:(NSData*)packedargs;
+/* lion's native fullscreen handling */
+- (void)windowWillEnterFullScreen:(NSNotification *)notification;
+- (void)windowWillExitFullScreen:(NSNotification *)notification;
+
@end
@interface VLCProgressBarGradientEffect : NSView {
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index fa308f2..b96c8a2 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1410,6 +1410,18 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
#pragma mark -
+#pragma mark Lion's native fullscreen handling
+- (void)windowWillEnterFullScreen:(NSNotification *)notification
+{
+ [NSCursor setHiddenUntilMouseMoves: YES];
+}
+
+- (void)windowWillExitFullScreen:(NSNotification *)notification
+{
+ [NSCursor setHiddenUntilMouseMoves: NO];
+}
+
+#pragma mark -
#pragma mark Side Bar Data handling
/* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
- (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item
More information about the vlc-commits
mailing list