]> git.sesse.net Git - vlc/commitdiff
macosx: support multiple VLC windows in fullscreen, try to just display fspanel when...
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Fri, 8 Feb 2013 18:39:11 +0000 (19:39 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 9 Feb 2013 17:44:39 +0000 (18:44 +0100)
This allows main window and video window in fullscreen
Note that still the fspanel is displayed to often.

modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/Windows.h
modules/gui/macosx/Windows.m
modules/gui/macosx/fspanel.m

index a23628f2b105ccd2685f68dc3f7fb36e8cebf397..9cb0cdd9979822ceaa333f88c1756f36aa6bd590 100644 (file)
         [[VLCMainWindow sharedInstance] setNonembedded:b_nonembedded];
 
     [o_vout_view setVoutThread:(vout_thread_t *)p_wnd->p_parent];
+    [o_new_video_window setHasActiveVideo: YES];
     [o_vout_dict setObject:[o_new_video_window autorelease] forKey:[NSValue valueWithPointer:p_wnd]];
 
     if (b_nonembedded) {
     if ([[VLCMainWindow sharedInstance] fullscreen] && ![[VLCMainWindow sharedInstance] nativeFullscreenMode])
         [o_window leaveFullscreen];
 
+    if ([[VLCMainWindow sharedInstance] fullscreen] && [[VLCMainWindow sharedInstance] nativeFullscreenMode])
+        [o_window toggleFullScreen: self];
+
+
     if (![NSStringFromClass([o_window class]) isEqualToString:@"VLCMainWindow"]) {
         [o_window orderOut:self];
     }
 
     [[o_window videoView] releaseVoutThread];
+    [o_window setHasActiveVideo: NO];
     [o_vout_dict removeObjectForKey:o_key];
 
     if ([o_vout_dict count] == 0)
index 460b38fa39a0e26ecd2e33e5fd50b2ae4daaefb5..f15ff80c44fd8aea22747a92918779bd74d217bd 100644 (file)
@@ -95,11 +95,12 @@ static const float f_min_video_height = 70.0;
     NSRecursiveLock * o_animation_lock;
     NSInteger i_originalLevel;
 
-
+    BOOL              b_has_active_video;
 }
 
 @property (nonatomic, assign) VLCVoutView* videoView;
 @property (readonly) VLCControlsBarCommon* controlsBar;
+@property (nonatomic, readwrite) BOOL hasActiveVideo;
 
 - (void)setWindowLevel:(NSInteger)i_state;
 
index 0a6d64e281200afbad243b52fb296b2b6b2b0424..a44120264d85ef93721ba72a06e5bb6c543b1ee6 100644 (file)
 
 @synthesize videoView=o_video_view;
 @synthesize controlsBar=o_controls_bar;
+@synthesize hasActiveVideo=b_has_active_video;
 
 #pragma mark -
 #pragma mark Init
 
     var_SetBool(pl_Get(VLCIntf), "fullscreen", true);
 
-    vout_thread_t *p_vout = getVoutForActiveWindow();
-    if (p_vout) {
-        var_SetBool(p_vout, "fullscreen", true);
-        vlc_object_release(p_vout);
+    if ([self hasActiveVideo]) {
+        vout_thread_t *p_vout = getVoutForActiveWindow();
+        if (p_vout) {
+            var_SetBool(p_vout, "fullscreen", true);
+            vlc_object_release(p_vout);
+        }
     }
 
     [o_video_view setFrame: [[self contentView] frame]];
         [self setFrame: winrect display:NO animate:NO];
     }
 
-    if ([[VLCMain sharedInstance] activeVideoPlayback])
+    // TODO fix bottom bar status when vout just not visible, but there
+    if (![o_video_view isHidden])
         [[o_controls_bar bottomBarView] setHidden: YES];
 
     [self setMovableByWindowBackground: NO];
     // But this creates some problems when leaving fs over remote intfs, so activate app here.
     [NSApp activateIgnoringOtherApps:YES];
 
-    
-    [[[VLCMainWindow sharedInstance] fsPanel] setVoutWasUpdated: self];
-    [[[VLCMainWindow sharedInstance] fsPanel] setActive: nil];
+    if ([self hasActiveVideo]) {
+        [[[VLCMainWindow sharedInstance] fsPanel] setVoutWasUpdated: self];
+        [[[VLCMainWindow sharedInstance] fsPanel] setActive: nil];
+    }
 
     NSArray *subviews = [[self videoView] subviews];
     NSUInteger count = [subviews count];
 {
     var_SetBool(pl_Get(VLCIntf), "fullscreen", false);
 
-    vout_thread_t *p_vout = getVoutForActiveWindow();
-    if (p_vout) {
-        var_SetBool(p_vout, "fullscreen", false);
-        vlc_object_release(p_vout);
+    if ([self hasActiveVideo]) {
+        vout_thread_t *p_vout = getVoutForActiveWindow();
+        if (p_vout) {
+            var_SetBool(p_vout, "fullscreen", false);
+            vlc_object_release(p_vout);
+        }
     }
 
     [NSCursor setHiddenUntilMouseMoves: NO];
index d941fc33ee97545eb57ad684a2518d464ad95638..bc69fac4b791fa2746e86b316868df2101d6b3e0 100644 (file)
 - (void)setActive:(id)noData
 {
     b_nonActive = NO;
-    [[VLCMain sharedInstance] showFullscreenController];
+
+    id currentWindow = [NSApp keyWindow];
+    if ([currentWindow respondsToSelector:@selector(hasActiveVideo)]) {
+        if ([currentWindow hasActiveVideo]) {
+            [[VLCMain sharedInstance] showFullscreenController];
+        }
+    }
 }
 
 /* This routine is called repeatedly to fade in the window */