]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/Windows.m
macosx/CAS: implement basic error checking for the stream-out settings
[vlc] / modules / gui / macosx / Windows.m
index 10332e70486a6ca9a7033c4f89d9ff2bb2fffbd8..4155f72f6a3505f84bd286cdbbb7a76e239a391b 100644 (file)
  *  Common code for main window, detached window and extra video window
  *****************************************************************************/
 
+@interface VLCVideoWindowCommon (Internal)
+- (void)customZoom:(id)sender;
+- (void)hasBecomeFullscreen;
+- (void)leaveFullscreenAndFadeOut:(BOOL)fadeout;
+- (void)hasEndedFullscreen;
+@end
+
 @implementation VLCVideoWindowCommon
 
 @synthesize videoView=o_video_view;
 
 - (void)setTitle:(NSString *)title
 {
+    if (!title || [title length] < 1)
+        return;
+
     if (b_dark_interface && o_titlebar_view)
         [o_titlebar_view setWindowTitle: title];
 
 
     if (o_controls_bar)
         [o_controls_bar setFullscreenState:YES];
+    [[[VLCMainWindow sharedInstance] controlsBar] setFullscreenState:YES];
 
     [[VLCMainWindow sharedInstance] recreateHideMouseTimer];
 
                 CGDisplayFade(token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES);
             }
 
-            if ([screen mainScreen])
-                [NSApp setPresentationOptions:(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
+            NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
+            if ([screen hasMenuBar])
+                presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
+            if ([screen hasMenuBar] || [screen hasDock])
+                presentationOpts |= NSApplicationPresentationAutoHideDock;
+            [NSApp setPresentationOptions:presentationOpts];
 
             [[o_video_view superview] replaceSubview:o_video_view with:o_temp_view];
             [o_temp_view setFrame:[o_video_view frame]];
         [o_fullscreen_anim2 release];
     }
 
-    if ([screen mainScreen])
-        [NSApp setPresentationOptions:(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
+    NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
+    if ([screen hasMenuBar])
+        presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
+    if ([screen hasMenuBar] || [screen hasDock])
+        presentationOpts |= NSApplicationPresentationAutoHideDock;
+    [NSApp setPresentationOptions:presentationOpts];
 
     dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
     dict2 = [[NSMutableDictionary alloc] initWithCapacity:3];
 
     if (o_controls_bar)
         [o_controls_bar setFullscreenState:NO];
+    [[[VLCMainWindow sharedInstance] controlsBar] setFullscreenState:NO];
 
     /* We always try to do so */
     [NSScreen unblackoutScreens];
 - (void)hasEndedFullscreen
 {
     [[VLCMainWindow sharedInstance] setFullscreen:NO];
-    
+
     /* This function is private and should be only triggered at the end of the fullscreen change animation */
     /* Make sure we don't see the o_video_view disappearing of the screen during this operation */
     NSDisableScreenUpdates();