Commit 3120c637 authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Felix Paul Kühne

macosx: improve memory and hotkey handling (in case a vout is active, but not the first responder)

(cherry picked from commit b3259ed4de03feded83222e6fe0837caabb8d20a)
parent 01e99e18
...@@ -647,6 +647,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -647,6 +647,8 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
if( !p_intf ) return; if( !p_intf ) return;
[self updateCurrentlyUsedHotkeys];
[o_mainwindow updateWindow]; [o_mainwindow updateWindow];
[o_mainwindow updateTimeSlider]; [o_mainwindow updateTimeSlider];
[o_mainwindow updateVolumeSlider]; [o_mainwindow updateVolumeSlider];
...@@ -1298,8 +1300,8 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1298,8 +1300,8 @@ unsigned int CocoaKeyToVLC( unichar i_key )
unsigned int i_pressed_modifiers = 0; unsigned int i_pressed_modifiers = 0;
const struct hotkey *p_hotkeys; const struct hotkey *p_hotkeys;
int i; int i;
NSMutableString *tempString = [[[NSMutableString alloc] init] autorelease]; NSMutableString *tempString = [[NSMutableString alloc] init];
NSMutableString *tempStringPlus = [[[NSMutableString alloc] init] autorelease]; NSMutableString *tempStringPlus = [[NSMutableString alloc] init];
val.i_int = 0; val.i_int = 0;
p_hotkeys = p_intf->p_libvlc->p_hotkeys; p_hotkeys = p_intf->p_libvlc->p_hotkeys;
...@@ -1336,6 +1338,8 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1336,6 +1338,8 @@ unsigned int CocoaKeyToVLC( unichar i_key )
if( key == 'f' && i_pressed_modifiers & NSControlKeyMask && i_pressed_modifiers & NSCommandKeyMask ) if( key == 'f' && i_pressed_modifiers & NSControlKeyMask && i_pressed_modifiers & NSCommandKeyMask )
{ {
[[VLCCoreInteraction sharedInstance] toggleFullscreen]; [[VLCCoreInteraction sharedInstance] toggleFullscreen];
[tempString release];
[tempStringPlus release];
return YES; return YES;
} }
...@@ -1351,12 +1355,16 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1351,12 +1355,16 @@ unsigned int CocoaKeyToVLC( unichar i_key )
case NSLeftArrowFunctionKey: case NSLeftArrowFunctionKey:
case NSEnterCharacter: case NSEnterCharacter:
case NSCarriageReturnCharacter: case NSCarriageReturnCharacter:
[tempString release];
[tempStringPlus release];
return NO; return NO;
} }
if( key == 0x0020 ) // space key if( key == 0x0020 ) // space key
{ {
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] play];
[tempString release];
[tempStringPlus release];
return YES; return YES;
} }
...@@ -1365,9 +1373,13 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1365,9 +1373,13 @@ unsigned int CocoaKeyToVLC( unichar i_key )
if( [o_usedHotkeys indexOfObject: tempString] != NSNotFound || [o_usedHotkeys indexOfObject: tempStringPlus] != NSNotFound ) if( [o_usedHotkeys indexOfObject: tempString] != NSNotFound || [o_usedHotkeys indexOfObject: tempStringPlus] != NSNotFound )
{ {
var_SetInteger( p_intf->p_libvlc, "key-pressed", val.i_int ); var_SetInteger( p_intf->p_libvlc, "key-pressed", val.i_int );
[tempString release];
[tempStringPlus release];
return YES; return YES;
} }
[tempString release];
[tempStringPlus release];
return NO; return NO;
} }
...@@ -1395,7 +1407,8 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1395,7 +1407,8 @@ unsigned int CocoaKeyToVLC( unichar i_key )
} }
} }
module_config_free (p_config); module_config_free (p_config);
o_usedHotkeys = [[NSArray alloc] initWithArray: o_usedHotkeys copyItems: YES]; o_usedHotkeys = [[NSArray alloc] initWithArray: o_tempArray copyItems: YES];
[o_tempArray release];
} }
#pragma mark - #pragma mark -
......
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