[vlc-commits] macosx: don't let the video window get larger than the screen it is on ( close #5875)

Felix Paul Kühne git at videolan.org
Thu Mar 1 19:42:46 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Mar  1 19:42:10 2012 +0100| [60296be1e97153dfa68cda49aeac8cebf95ffdb1] | committer: Felix Paul Kühne

macosx: don't let the video window get larger than the screen it is on (close #5875)
(cherry picked from commit 93b211422cf7fa0c7e61c355da2068e7e0e56a69)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=60296be1e97153dfa68cda49aeac8cebf95ffdb1
---

 modules/video_output/macosx.m |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 214c1a1..385b811 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -356,6 +356,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             NSRect windowFrame = [o_window frame];
             NSRect glViewFrame = [sys->glView frame];
             NSSize windowMinSize = [o_window minSize];
+            NSSize windowMaxSize = [o_window constrainFrameRect: windowFrame toScreen: [o_window screen]].size;
 
             topleftbase.x = 0;
             topleftbase.y = windowFrame.size.height;
@@ -370,6 +371,12 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             if (i_height < windowMinSize.height)
                 i_height = windowMinSize.height;
 
+            /* don't make the window than its screen */
+            if (i_width > windowMaxSize.width)
+                i_width = windowMaxSize.width;
+            if (i_height > windowMaxSize.height)
+                i_height = windowMaxSize.height;
+
             if( i_height != glViewFrame.size.height || i_width != glViewFrame.size.width )
             {
                 new_frame.size.width = windowFrame.size.width - glViewFrame.size.width + i_width;



More information about the vlc-commits mailing list