[vlc-devel] [PATCH] macosx vout: show complete window if we would resize beyond screen bounds

David Fuhrmann david.fuhrmann at googlemail.com
Sun Mar 4 13:10:54 CET 2012


Hi,

I just thought that we could also move the complete block. This makes the code more simple and cleaner. So, please use attached version instead.
Thanks.

Greetings,
David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-macosx-vout-show-complete-window-if-we-would-resize-.patch
Type: application/octet-stream
Size: 2945 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120304/5f9d0101/attachment.obj>
-------------- next part --------------


Am 04.03.2012 um 12:49 schrieb David Fuhrmann:

> In addition to the previous commit from Felix, also make sure that if we would resize
> beyond the screen we set the origin values to ensure that the complete window is visible.
> ---
> modules/video_output/macosx.m |   17 ++++++++++++-----
> 1 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
> index 5e7ddee..e4962c6 100644
> --- a/modules/video_output/macosx.m
> +++ b/modules/video_output/macosx.m
> @@ -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];
> -- 
> 1.7.7.5 (Apple Git-26)
> 



More information about the vlc-devel mailing list