Commit 4777cf0d authored by Daksh Shah's avatar Daksh Shah

draggablePanel for multiple Vout Windows

parent f287ebb1
......@@ -63,11 +63,10 @@
- (void)setActive;
- (void)setNonActive;
- (void)setVoutWasUpdated:(VLCWindow *)voutWindow;
- (void)centerPanel; //Have to find a better alternative than to centering each time on resize/drag
- (void)fixTitleBar;
- (void)unFixTitleBar;
- (void)showTitleBar;
- (void)hideTitleBar;
- (void)setSeekable:(BOOL)seekable;
- (void)setVolumeLevel:(int)value;
......
......@@ -238,7 +238,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
//Issue-3, the titleBar should be shown/hidden only for the respective window of FSPanel...
_associatedVoutWindow.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
| NSMiniaturizableWindowMask;
[self showTitleBar];
// [self showTitleBar];
//[_associatedVoutWindow showControlsBar]; //It apparently does not have showControlsBar, because it is a NSWindow... would have to figure out a way to hide/show it
}
......@@ -247,12 +247,6 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
_associatedVoutWindow.styleMask |= NSFullSizeContentViewWindowMask;
}
- (void)showTitleBar
{
[[[[_associatedVoutWindow standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
}
- (void)hideTitleBar
{
[[[[_associatedVoutWindow standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:0];
......@@ -446,7 +440,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
[self fadeOut];
[self hideMouse];
//Issue-3
//Issue-3 //maybe not the right way to go about it. Why hide titleBars for all vout windows? and maybe this should not be a part of draggablepanel at all
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel hideTitleBar];
}];
......
......@@ -34,10 +34,12 @@
- (void)mouseDown:(NSEvent *)event
{
NSLog(@"mouseDown"); //Debug-Statement
NSWindow *window = [self window];
NSRect mouseLocationInWindow = {[event locationInWindow], {0,0}};
NSPoint originalMouseLocation = [window convertRectToScreen:mouseLocationInWindow].origin;
NSRect originalFrame = [window frame];
NSLog(@"%f",originalFrame.origin.x); //Debug-Statement
while (YES)
{
......
This diff is collapsed.
......@@ -26,6 +26,7 @@
#import <vlc_vout_window.h>
#import "VLCKeyboardBacklightControl.h"
#import "VLCFSPanelController.h"
@class VLCControlsBarCommon;
@class VLCVideoWindowCommon;
......@@ -42,6 +43,7 @@
- (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd withAnimation:(BOOL)b_animation;
- (void)updateControlsBarsUsingBlock:(void (^)(VLCControlsBarCommon *controlsBar))block;
- (void)updateDraggablePanelsUsingBlock: (void (^)(VLCFSPanelController *draggablepanel))block;
- (void)updateWindowsUsingBlock:(void (^)(VLCVideoWindowCommon *o_window))windowUpdater;
- (void)updateWindowLevelForHelperWindows:(NSInteger)i_level;
......
......@@ -368,6 +368,9 @@ void WindowClose(vout_window_t *p_wnd)
[voutView setVoutThread:(vout_thread_t *)p_wnd->obj.parent];
[newVideoWindow setHasActiveVideo: YES];
// newVideoWindow.styleMask |= NSFullSizeContentViewWindowMask;//would this be the right place for it? //Issue-3
[newVideoWindow hideControlsBar];
[voutWindows setObject:newVideoWindow forKey:[NSValue valueWithPointer:p_wnd]];
[[VLCMain sharedInstance] setActiveVideoPlayback: YES];
......@@ -560,6 +563,18 @@ void WindowClose(vout_window_t *p_wnd)
}];
}
- (void)updateDraggablePanelsUsingBlock: (void (^)(VLCFSPanelController *draggablepanel))block
{
[voutWindows enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([obj respondsToSelector:@selector(draggablepanel)]) {
VLCFSPanelController *o_draggablepanel = [obj draggablepanel];
if (o_draggablepanel && block)
block(o_draggablepanel);
}
}];
}
- (void)updateWindowsUsingBlock:(void (^)(VLCVideoWindowCommon *o_window))windowUpdater
{
[voutWindows enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
......
......@@ -24,6 +24,7 @@
#import <Cocoa/Cocoa.h>
#import "VLCWindow.h"
#import "VLCFSPanelController.h"
@class VLCVoutView;
......@@ -47,6 +48,7 @@ static const float f_min_video_height = 70.0;
@property (readonly) BOOL windowShouldExitFullscreenWhenFinished;
@property (readwrite, assign) NSRect previousSavedFrame;
@property (nonatomic, readwrite, assign) NSSize nativeVideoSize;
@property (readonly) VLCFSPanelController* draggablepanel;
- (void)setWindowLevel:(NSInteger)i_state;
- (void)resizeWindow;
......
......@@ -80,6 +80,12 @@
- (void)awakeFromNib
{
_draggablepanel = [[VLCFSPanelController alloc] init];
[_draggablepanel showWindow:self];
[[self draggablepanel] setVoutWasUpdated:self];
// [self.draggablepanel setActive]; //doubtful
NSLog(@"AWAKEFROMNIB in VLCVideoWindowCommon"); //Debug-Statement
BOOL b_nativeFullscreenMode = var_InheritBool(getIntf(), "macosx-nativefullscreenmode");
if (b_nativeFullscreenMode) {
......@@ -377,17 +383,22 @@
[super becomeKeyWindow];
// change fspanel state for the case when multiple windows are in fullscreen
if ([self hasActiveVideo] && [self fullscreen])
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
else
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
//I am not sure what this means... earlier there was just one fspanel...
//removing it for now, as it is creating an error: when video is played in a separate Vout window then the controller on ML/Playlist window becomes active when the Vout window becomes keyWindow
// NSLog(@"becomeKeyWindow and activeVideo %hhd", [self hasActiveVideo]);
// if ([self hasActiveVideo])
// [[[[VLCMain sharedInstance] mainWindow] draggablepanel] setActive];
// else
// [[[[VLCMain sharedInstance] mainWindow] draggablepanel] setNonActive];
}
- (void)resignKeyWindow
{
[super resignKeyWindow];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
//This file is for all the video windows right? Then how do I know whether mainWindow has resigned as KeyWindow or is it some other vout window? because, I will have to set Not Active that particular window's draggablepanel. Right?
[[[[VLCMain sharedInstance] mainWindow] draggablepanel] setNonActive];
}
-(NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
......@@ -472,11 +483,12 @@
[self setFullscreen: YES];
_inFullscreenTransition = NO;
if ([self hasActiveVideo]) {
[[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:self];
if (![_videoView isHidden])
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
}
//Would I need to do something here? #check
// if ([self hasActiveVideo]) {
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:self];
// if (![_videoView isHidden])
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
// }
NSArray *subviews = [[self videoView] subviews];
NSUInteger count = [subviews count];
......@@ -503,7 +515,6 @@
}
[NSCursor setHiddenUntilMouseMoves: NO];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
if (![_videoView isHidden]) {
[self showControlsBar];
......@@ -684,9 +695,7 @@
[o_fullscreen_window makeKeyWindow];
[o_fullscreen_window setAcceptsMouseMovedEvents: YES];
/* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:o_fullscreen_window];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
[[[[VLCMain sharedInstance] mainWindow] draggablepanel] setVoutWasUpdated:o_fullscreen_window]; //fix
if ([self isVisible])
[self orderOut: self];
......@@ -715,7 +724,6 @@
return;
}
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
[[o_fullscreen_window screen] setNonFullscreenPresentationOptions];
if (o_fullscreen_anim1) {
......
......@@ -229,19 +229,11 @@
{
NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil];
if ([self mouse: ml inRect: [self bounds]]){
//NSLog(@"VLCVoutView mouseMoved");//Debug-Statement
// NSLog(@"VLCVoutView mouseMoved");//Debug-Statement
//It is triggered only in the Video Playing windows, not Playlist view, which is perfect
//Issue-3
// [[[[[[VLCMain sharedInstance] mainWindow] standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel showTitleBar];
}];
//[[VLCMain sharedInstance] mainWindow].titlebarAppearsTransparent = false;//<seems unneccesary
[[VLCMain sharedInstance] showFullscreenController];
[[[[((VLCVideoWindowCommon*)self.window) standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1]; //Issue-3
[[((VLCVideoWindowCommon*)self.window) draggablepanel] setActive];
}
[super mouseMoved: o_event];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment