vlc/vlc-2.0 | branch: master | David Fuhrmann <[email protected]> | 
Fri Jul  6 14:24:27 2012 +0200| [7ab519f69b394d2aa3e9e6eec7f385809b644b9f] | 
committer: David Fuhrmann

macosx: don't allow a automatic resize beyond the right screen border
(cherry picked from commit 4b40a27d7c642132eb9f2de5209cca76ab85be79)

Signed-off-by: David Fuhrmann <[email protected]>

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

 modules/gui/macosx/MainWindow.m |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index ee86c8a..d6d2363 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1666,6 +1666,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
     if( new_frame.origin.y < screenFrame.origin.y )
         new_frame.origin.y = screenFrame.origin.y;
 
+    CGFloat right_screen_point = screenFrame.origin.x + screenFrame.size.width;
+    CGFloat right_window_point = new_frame.origin.x + new_frame.size.width;
+    if( right_window_point > right_screen_point )
+        new_frame.origin.x -= ( right_window_point - right_screen_point );
+
     [[o_videoWindow animator] setFrame:new_frame display:YES];
 }
 

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to