Commit 3effe298 authored by David Fuhrmann's avatar David Fuhrmann Committed by Felix Paul Kühne

macosx vout: show complete window if we would resize beyond screen bounds

Make sure that if we would resize beyond the screen we set the origin values to ensure that the complete window is visible.
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 8f813fc4
......@@ -355,7 +355,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
return VLC_SUCCESS; // this is okay, since the event will occur again when we have a window
NSRect windowFrame = [o_window frame];
NSRect glViewFrame = [sys->glView frame];
NSSize screenSize = [[o_window screen] visibleFrame].size;
NSRect screenFrame = [[o_window screen] visibleFrame];
NSSize windowMinSize = [o_window minSize];
topleftbase.x = 0;
......@@ -372,10 +372,11 @@ static int Control (vout_display_t *vd, int query, va_list ap)
i_height = windowMinSize.height;
/* make sure the window doesn't exceed the screen size the window is on */
if (i_width > screenSize.width)
i_width = screenSize.width;
if (i_height > screenSize.height)
i_height = screenSize.height;
if (i_width > screenFrame.size.width)
{
topleftscreen.x = screenFrame.origin.x;
i_width = screenFrame.size.width;
}
if( i_height != glViewFrame.size.height || i_width != glViewFrame.size.width )
{
......@@ -385,6 +386,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
new_frame.origin.x = topleftscreen.x;
new_frame.origin.y = topleftscreen.y - new_frame.size.height;
if( new_frame.size.height > screenFrame.size.height )
{
new_frame.size.height = screenFrame.size.height;
new_frame.origin.y = screenFrame.origin.y;
}
[sys->glView performSelectorOnMainThread:@selector(setWindowFrameWithValue:) withObject:[NSValue valueWithRect:new_frame] waitUntilDone:NO];
}
[o_pool release];
......
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