if( i_pressed_modifiers & NSCommandKeyMask )
val.i_int |= KEY_MODIFIER_COMMAND;
- key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0];
+ key = [[[o_event charactersIgnoringModifiers] lowercaseString] characterAtIndex: 0];
if( key )
{
[self toggleFullscreen];
}
}
- else if ( key == ' ' )
+ else if ( p_vout )
{
- vlc_value_t val;
- val.i_int = config_GetInt( p_vout, "key-play-pause" );
- var_Set( p_vout->p_libvlc, "key-pressed", val );
- }
- else
- {
- val.i_int |= CocoaKeyToVLC( key );
+ if( key == ' ')
+ val.i_int = config_GetInt( p_vout, "key-play-pause" );
+ else
+ val.i_int |= (int)CocoaKeyToVLC( key );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
+ else NSLog( @"Could not send keyevent to VLC core" );
}
else
- {
[super keyDown: o_event];
- }
}
- (void)mouseDown:(NSEvent *)o_event
- (void)manage
{
+ /* Dooh, why do we spend processor time doing this kind of stuff? */
[super manage];
unsigned int i_mouse_hide_timeout =
- var_GetInteger(p_vout, "mouse-hide-timeout") * 1000;
+ var_CreateGetInteger(p_vout, "mouse-hide-timeout") * 1000;
+
+ if( i_mouse_hide_timeout < 100000 )
+ i_mouse_hide_timeout = 100000;
if( p_vout->b_fullscreen )
{
if( mdate() - i_time_mouse_last_moved > i_mouse_hide_timeout )
{
+ i_time_mouse_last_moved = mdate();
[self hideMouse: YES];
}
}
- (void)enterFullscreen
{
- [super enterFullscreen];
[o_window performSelectorOnMainThread: @selector(enterFullscreen) withObject: NULL waitUntilDone: NO];
+ [super enterFullscreen];
}
- (void)leaveFullscreen
{
- [super leaveFullscreen];
[o_window performSelectorOnMainThread: @selector(leaveFullscreen) withObject: NULL waitUntilDone: NO];
+ [super leaveFullscreen];
}
[o_window setAcceptsMouseMovedEvents: TRUE];
- if( var_GetBool( p_real_vout, "video-on-top" ) )
+ if( var_CreateGetBool( p_real_vout, "video-on-top" ) )
{
[o_window setLevel: NSStatusWindowLevel];
}
screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device];
if( !screen ) screen = [self screen];
- if( b_black && [[NSScreen screens] count] > 1)
- {
- CGDisplayFadeReservationToken token;
- CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
- CGDisplayFade( token, 0.2 , kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
-
+ if( b_black )
[screen blackoutOtherScreens];
- CGDisplayFade( token, 0.1 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
- CGReleaseDisplayFadeReservation( token);
- }
-
[self setMovableByWindowBackground: NO];
- /* tell the fspanel to move itself to front next time it's triggered */
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: i_device];
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
-
if( [screen isMainScreen] )
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
initialFrame = [self frame];
[self setFrame:[screen frame] display:YES animate:YES];
+ [self setLevel:NSNormalWindowLevel];
+
+ /* tell the fspanel to move itself to front next time it's triggered */
+ [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: i_device];
+ [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
+
fullscreen = YES;
}
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
[self setFrame:initialFrame display:YES animate:YES];
[self setMovableByWindowBackground: YES];
+ if( var_GetBool( p_vout, "video-on-top" ) )
+ [self setLevel: NSStatusWindowLevel];
}
- (id)getVoutView // FIXME Naming scheme!