Commit 46c93c9c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

gui/*macosx: Don't rely on carbon or on old non 64 bits API when possible.

parent c3a1a712
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
* Preamble * Preamble
*****************************************************************************/ *****************************************************************************/
/* DisableScreenUpdates, SetSystemUIMode, ... */
#import <Carbon/Carbon.h>
#import "intf.h" #import "intf.h"
#import "controls.h" #import "controls.h"
#import "vout.h" #import "vout.h"
...@@ -287,7 +284,7 @@ ...@@ -287,7 +284,7 @@
CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
if ([screen isMainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:NO];
[[self contentView] replaceSubview:o_view with:o_temp_view]; [[self contentView] replaceSubview:o_view with:o_temp_view];
[o_temp_view setFrame:[o_view frame]]; [o_temp_view setFrame:[o_view frame]];
...@@ -308,16 +305,12 @@ ...@@ -308,16 +305,12 @@
} }
/* Make sure we don't see the o_view disappearing of the screen during this operation */ /* Make sure we don't see the o_view disappearing of the screen during this operation */
#ifndef __x86_64__ NSEnableScreenUpdates();
DisableScreenUpdates();
#endif
[[self contentView] replaceSubview:o_view with:o_temp_view]; [[self contentView] replaceSubview:o_view with:o_temp_view];
[o_temp_view setFrame:[o_view frame]]; [o_temp_view setFrame:[o_view frame]];
[o_fullscreen_window setContentView:o_view]; [o_fullscreen_window setContentView:o_view];
[o_fullscreen_window makeKeyAndOrderFront:self]; [o_fullscreen_window makeKeyAndOrderFront:self];
#ifndef __x86_64__ NSDisableScreenUpdates();
EnableScreenUpdates();
#endif
} }
/* We are in fullscreen (and no animation is running) */ /* We are in fullscreen (and no animation is running) */
...@@ -341,7 +334,7 @@ ...@@ -341,7 +334,7 @@
} }
if ([screen isMainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:NO];
dict1 = [[NSMutableDictionary alloc] initWithCapacity:2]; dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
dict2 = [[NSMutableDictionary alloc] initWithCapacity:3]; dict2 = [[NSMutableDictionary alloc] initWithCapacity:3];
...@@ -431,7 +424,7 @@ ...@@ -431,7 +424,7 @@
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil]; [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:YES];
/* Will release the lock */ /* Will release the lock */
[self hasEndedFullscreen]; [self hasEndedFullscreen];
...@@ -449,7 +442,7 @@ ...@@ -449,7 +442,7 @@
[self orderFront: self]; [self orderFront: self];
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil]; [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:YES];
if (o_fullscreen_anim1) if (o_fullscreen_anim1)
{ {
...@@ -504,9 +497,7 @@ ...@@ -504,9 +497,7 @@
{ {
/* This function is private and should be only triggered at the end of the fullscreen change animation */ /* This function is private and should be only triggered at the end of the fullscreen change animation */
/* Make sure we don't see the o_view disappearing of the screen during this operation */ /* Make sure we don't see the o_view disappearing of the screen during this operation */
#ifndef __x86_64__ NSDisableScreenUpdates();
DisableScreenUpdates();
#endif
[o_view retain]; [o_view retain];
[o_view removeFromSuperviewWithoutNeedingDisplay]; [o_view removeFromSuperviewWithoutNeedingDisplay];
[[self contentView] replaceSubview:o_temp_view with:o_view]; [[self contentView] replaceSubview:o_temp_view with:o_view];
...@@ -516,9 +507,7 @@ ...@@ -516,9 +507,7 @@
if ([self isVisible]) if ([self isVisible])
[super makeKeyAndOrderFront:self]; /* our version contains a workaround */ [super makeKeyAndOrderFront:self]; /* our version contains a workaround */
[o_fullscreen_window orderOut: self]; [o_fullscreen_window orderOut: self];
#ifndef __x86_64__ NSEnableScreenUpdates();
EnableScreenUpdates();
#endif
[o_fullscreen_window release]; [o_fullscreen_window release];
o_fullscreen_window = nil; o_fullscreen_window = nil;
......
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
/* prevent system sleep */ /* prevent system sleep */
#import <CoreServices/CoreServices.h> #import <CoreServices/CoreServices.h>
#import <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h>
/* SystemUIMode */
#import <Carbon/Carbon.h>
#include <vlc_keys.h> #include <vlc_keys.h>
...@@ -1117,7 +1113,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1117,7 +1113,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[self setMovableByWindowBackground: NO]; [self setMovableByWindowBackground: NO];
if( [screen isMainScreen] ) if( [screen isMainScreen] )
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:NO];
initialFrame = [self frame]; initialFrame = [self frame];
[self setFrame:[screen frame] display:YES animate:YES]; [self setFrame:[screen frame] display:YES animate:YES];
...@@ -1138,7 +1134,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1138,7 +1134,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[NSScreen unblackoutScreens]; [NSScreen unblackoutScreens];
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil]; [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:YES];
[self setFrame:initialFrame display:YES animate:YES]; [self setFrame:initialFrame display:YES animate:YES];
[self setMovableByWindowBackground: YES]; [self setMovableByWindowBackground: YES];
if( var_GetBool( p_vout, "video-on-top" ) ) if( var_GetBool( p_vout, "video-on-top" ) )
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#include "VLCOpenGLVoutView.h" #include "VLCOpenGLVoutView.h"
#include "VLCMinimalVoutWindow.h" #include "VLCMinimalVoutWindow.h"
/* SetSystemUIMode, ... */
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
@implementation VLCMinimalVoutWindow @implementation VLCMinimalVoutWindow
...@@ -67,14 +64,14 @@ ...@@ -67,14 +64,14 @@
{ {
fullscreen = YES; fullscreen = YES;
initialFrame = [self frame]; initialFrame = [self frame];
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:NO];
[self setFrame:[[self screen] frame] display:YES animate:YES]; [self setFrame:[[self screen] frame] display:YES animate:YES];
} }
- (void)leaveFullscreen - (void)leaveFullscreen
{ {
fullscreen = NO; fullscreen = NO;
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); [NSMenu setMenuBarVisible:YES];
[self setFrame:initialFrame display:YES animate:YES]; [self setFrame:initialFrame display:YES animate:YES];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment