]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/vout.m
gui/macosx: fix crash when the volume slider has been modified.
[vlc] / modules / gui / macosx / vout.m
index 9027baf14de51cdb381c263233aef567eeac3d12..ebc803af1470ff56f4e823802292cd69b5808040 100644 (file)
 
 /* 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>
 
 #include "intf.h"
 #include "fspanel.h"
@@ -49,6 +51,9 @@
 #import "controls.h"
 #import "embeddedwindow.h"
 
+#include <vlc_common.h>
+#include <vlc_keys.h>
+
 /*****************************************************************************
  * DeviceCallback: Callback triggered when the video-device variable is changed
  *****************************************************************************/
@@ -287,7 +292,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
     if( !p_vout ) return;
 
-    p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT );
+    p_input = getInput();
 
     if( !p_input ) return;
 
@@ -431,9 +436,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 {
     vlc_value_t val;
     if( !p_real_vout ) return;
-    var_Get( p_real_vout, "fullscreen", &val );
-    val.b_bool = !val.b_bool;
-    var_Set( p_real_vout, "fullscreen", val );
+    var_ToggleBool( p_real_vout, "fullscreen" );
 }
 
 - (BOOL)isFullscreen
@@ -455,7 +458,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     if( !VLCIntf || !VLCIntf->p_sys )
         return;
 
-    UInt8 UsrActivity;
     if( VLCIntf->p_sys->i_play_status == PLAYING_S )
         UpdateSystemActivity( UsrActivity );
 }
@@ -967,7 +969,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         if ([o_window isVisible] && (![o_window isFullscreen]))
             [o_window makeKeyAndOrderFront: self];
 
-        [self scaleWindowWithFactor: 1.0 animate: [o_window isVisible] && (![o_window isFullscreen])];
+        if ( [self window] != o_embeddedwindow )
+            [self scaleWindowWithFactor: 1.0 animate: [o_window isVisible] && (![o_window isFullscreen])];
 
         [o_embeddedwindow setVideoRatio:[self voutSizeForFactor:1.0]];
 
@@ -1139,6 +1142,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
     [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
     SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
+
     [self setFrame:initialFrame display:YES animate:YES];
     [self setMovableByWindowBackground: YES];
     if( var_GetBool( p_vout, "video-on-top" ) )