[vlc-devel] commit: macosx: fixed menubar appearance in fullscreen mode by partially reverting [ 46c93c9cc984b99142b6e7321c8f5c4c8c4e65bb] ( Felix Paul Kühne )

git version control git at videolan.org
Wed May 20 18:54:01 CEST 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed May 20 18:22:39 2009 +0200| [63980c43dd72fe0f6909f61304a5384743e452ee] | committer: Felix Paul Kühne 

macosx: fixed menubar appearance in fullscreen mode by partially reverting [46c93c9cc984b99142b6e7321c8f5c4c8c4e65bb]

There is no 64bit-save aka non-Carbon replacement for this feature yet.

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=63980c43dd72fe0f6909f61304a5384743e452ee
---

 modules/gui/macosx/embeddedwindow.m               |   11 +++++++----
 modules/gui/macosx/vout.m                         |   11 +++++++++--
 modules/gui/minimal_macosx/VLCMinimalVoutWindow.m |    7 +++++--
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m
index adcec67..b59ccf9 100644
--- a/modules/gui/macosx/embeddedwindow.m
+++ b/modules/gui/macosx/embeddedwindow.m
@@ -32,6 +32,9 @@
 #import "embeddedwindow.h"
 #import "fspanel.h"
 
+/* SetSystemUIMode, ... */
+#import <Carbon/Carbon.h>
+
 /*****************************************************************************
  * VLCEmbeddedWindow Implementation
  *****************************************************************************/
@@ -284,7 +287,7 @@
             CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
  
             if ([screen isMainScreen])
-                [NSMenu setMenuBarVisible:NO];
+                SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
  
             [[self contentView] replaceSubview:o_view with:o_temp_view];
             [o_temp_view setFrame:[o_view frame]];
@@ -334,7 +337,7 @@
     }
  
     if ([screen isMainScreen])
-        [NSMenu setMenuBarVisible:NO];
+        SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
 
     dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
     dict2 = [[NSMutableDictionary alloc] initWithCapacity:3];
@@ -424,7 +427,7 @@
         CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
 
         [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
-        [NSMenu setMenuBarVisible:YES];
+        SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
 
         /* Will release the lock */
         [self hasEndedFullscreen];
@@ -442,7 +445,7 @@
     [self orderFront: self];
 
     [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
-    [NSMenu setMenuBarVisible:YES];
+    SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
 
     if (o_fullscreen_anim1)
     {
diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m
index 224ed25..add95df 100644
--- a/modules/gui/macosx/vout.m
+++ b/modules/gui/macosx/vout.m
@@ -36,6 +36,13 @@
 
 /* prevent system sleep */
 #import <CoreServices/CoreServices.h>
+/* FIXME: HACK!! */
+#ifdef __x86_64__
+#import <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h>
+#endif
+
+/* SystemUIMode */
+#import <Carbon/Carbon.h>
 
 #include <vlc_keys.h>
 
@@ -1113,7 +1120,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     [self setMovableByWindowBackground: NO];
 
     if( [screen isMainScreen] )
-        [NSMenu setMenuBarVisible:NO];
+        SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
 
     initialFrame = [self frame];
     [self setFrame:[screen frame] display:YES animate:YES];
@@ -1134,7 +1141,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     [NSScreen unblackoutScreens];
 
     [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
-    [NSMenu setMenuBarVisible:YES];
+    SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
 
     [self setFrame:initialFrame display:YES animate:YES];
     [self setMovableByWindowBackground: YES];
diff --git a/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m b/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
index 8d998c9..f3357e0 100644
--- a/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
+++ b/modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
@@ -31,6 +31,9 @@
 
 #import <Cocoa/Cocoa.h>
 
+/* SetSystemUIMode, ... */
+#import <Carbon/Carbon.h>
+
 @implementation VLCMinimalVoutWindow
 - (id)initWithContentRect:(NSRect)contentRect
 {
@@ -64,14 +67,14 @@
 {
     fullscreen = YES;
     initialFrame = [self frame];
-    [NSMenu setMenuBarVisible:NO];
+    SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
     [self setFrame:[[self screen] frame] display:YES animate:YES];
 }
 
 - (void)leaveFullscreen
 {
     fullscreen = NO;
-    [NSMenu setMenuBarVisible:YES];
+    SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
     [self setFrame:initialFrame display:YES animate:YES];
 }
 




More information about the vlc-devel mailing list