Commit 1ea27b12 authored by David Fuhrmann's avatar David Fuhrmann Committed by Felix Paul Kühne

macosx: set video frame to detached window frame, instead of vice versa

Now, the detached window position is restored on relaunch. Furthermore, this fixes some positioning issue when switching from macosx-background to detached video view.

Manual backport of 41631564e91d928f762d0aa56417e93c32db0a52
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 3e25459f
...@@ -1556,23 +1556,26 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1556,23 +1556,26 @@ static VLCMainWindow *_o_sharedInstance = nil;
if ([o_video_view superview] != NULL) if ([o_video_view superview] != NULL)
[o_video_view removeFromSuperviewWithoutNeedingDisplay]; [o_video_view removeFromSuperviewWithoutNeedingDisplay];
NSRect frame = [o_detached_video_window frame]; NSRect videoFrame;
NSRect videoFrame = [o_video_view frame]; videoFrame.size = [[o_detached_video_window contentView] frame].size;
frame.size.width = videoFrame.size.width;
if (b_video_deco) if (b_video_deco)
frame.size.height = videoFrame.size.height + [o_detached_bottombar_view frame].size.height + [o_titlebar_view frame].size.height; {
videoFrame.size.height -= [o_detached_bottombar_view frame].size.height;
if( b_dark_interface )
videoFrame.size.height -= [o_detached_titlebar_view frame].size.height;
videoFrame.origin.x = .0;
videoFrame.origin.y = [o_detached_bottombar_view frame].size.height;
}
else else
{ {
frame.size.height = videoFrame.size.height;
videoFrame.origin.y = .0; videoFrame.origin.y = .0;
videoFrame.origin.x = .0; videoFrame.origin.x = .0;
[o_video_view setFrame: videoFrame];
} }
[o_detached_video_window setFrame: frame display: NO]; [o_video_view setFrame: videoFrame];
[[o_detached_video_window contentView] addSubview: o_video_view positioned:NSWindowAbove relativeTo:nil]; [[o_detached_video_window contentView] addSubview: o_video_view positioned:NSWindowAbove relativeTo:nil];
[o_detached_video_window setLevel:NSNormalWindowLevel]; [o_detached_video_window setLevel:NSNormalWindowLevel];
[o_detached_video_window useOptimizedDrawing: YES]; [o_detached_video_window useOptimizedDrawing: YES];
[o_detached_video_window center];
b_nonembedded = YES; b_nonembedded = YES;
} }
[[o_video_view window] makeKeyAndOrderFront: self]; [[o_video_view window] makeKeyAndOrderFront: self];
......
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