]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/vout.m
Input access locking, part 3 (final).
[vlc] / modules / gui / macosx / vout.m
index 389e2302422f1df04882504401eb09d36bb4e3f9..3d7330e4d221f320b871b580793bdc3e1f3a67b8 100644 (file)
@@ -285,12 +285,14 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         return;
     }
 
-    if( input_GetItem(p_input)->psz_name != NULL )
-        o_title = [NSMutableString stringWithUTF8String:
-            input_GetItem(p_input)->psz_name];
-    if( input_GetItem(p_input)->psz_uri != NULL )
-        o_mrl = [NSMutableString stringWithUTF8String:
-            input_GetItem(p_input)->psz_uri];
+    char *psz_name = input_item_GetName( input_GetItem( p_input ) );
+    char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
+    if( psz_name != NULL )
+        o_title = [NSMutableString stringWithUTF8String: psz_name];
+    if( psz_uri != NULL )
+        o_mrl = [NSMutableString stringWithUTF8String: psz_uri];
+    free( psz_name );
+    free( psz_uri );
     if( o_title == nil )
         o_title = o_mrl;
 
@@ -439,6 +441,12 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     return o_window;
 }
 
+- (void)scrollWheel:(NSEvent *)theEvent
+{
+    VLCControls * o_controls = (VLCControls *)[[NSApp delegate] getControls];
+    [o_controls scrollWheel: theEvent];
+}
+
 - (void)keyDown:(NSEvent *)o_event
 {
     unichar key = 0;
@@ -751,13 +759,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
 - (void)enterFullscreen
 {
-    [[o_view class] resetVout: p_vout];
+    [[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
     [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
 }
 
 - (void)leaveFullscreen
 {
-    [[o_view class] resetVout: p_vout];
+    [[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
     [[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
 }
 
@@ -939,6 +947,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
         [self scaleWindowWithFactor: 1.0 animate: [o_window isVisible] && (![o_window isFullscreen])];
 
+        [o_window setAspectRatio:NSMakeSize([o_window frame].size.width, [o_window frame].size.height)];
+
         /* Make sure our window is visible, if we are not in fullscreen */
         if (![o_window isFullscreen])
             [o_window makeKeyAndOrderFront: self];
@@ -1031,7 +1041,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         /* move the FSPanel to front in case that it is currently shown
          * this won't and is not supposed to work when it's fading right now */
         if( [[[[VLCMain sharedInstance] getControls] getFSPanel] isDisplayed] )
-            [[[[VLCMain sharedInstance] getControls] getFSPanel] orderFront: self];
+            [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
         
         /* tell the fspanel to move itself to front next time it's triggered */
         [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: i_device];