]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/embeddedwindow.m
Support other displays fade out. Change video-device to point to the unique screen ID.
[vlc] / modules / gui / macosx / embeddedwindow.m
index 29cdb1de33b86e47f0861e36229e74bb5a2e23e0..c466a9364e03345bd49f1be0fb94c4f199014aee 100644 (file)
     vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
     BOOL blackout_other_displays = var_GetBool( p_vout, "macosx-black" );
 
-    /* We should get the screen pointed by var_GetInteger( p_vout, "video-device" ) */
-    screen = [self screen];
+    screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
 
     vlc_object_release( p_vout );
 
+    if (!screen)
+        screen = [self screen];
+
     screen_rect = [screen frame];
 
     [o_btn_fullscreen setState: YES];
     [NSCursor setHiddenUntilMouseMoves: YES];
     
     if (blackout_other_displays)
-        ; /* We should do something like [screen blackoutOtherScreens]; */
+        [screen blackoutOtherScreens]; /* We should do something like [screen blackoutOtherScreens]; */
 
     /* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */
     if (!o_fullscreen_window)
     [o_fullscreen_window setAcceptsMouseMovedEvents: TRUE];
 
     /* tell the fspanel to move itself to front next time it's triggered */
-    [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: 0 /* Get this right */];
+    [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
     
     [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
 }
     
     [o_btn_fullscreen setState: NO];
 
+    /* We always try to do so */
+    [NSScreen unblackoutScreens];
+
     /* Don't do anything if o_fullscreen_window is already closed */
     if (!o_fullscreen_window)
         return;