[vlc-commits] macosx: don't allow a automatic resize beyond the right screen border

David Fuhrmann git at videolan.org
Fri Jul 6 15:42:17 CEST 2012


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Jul  6 14:24:27 2012 +0200| [4b40a27d7c642132eb9f2de5209cca76ab85be79] | committer: David Fuhrmann

macosx: don't allow a automatic resize beyond the right screen border

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4b40a27d7c642132eb9f2de5209cca76ab85be79
---

 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 98a0ba8..b996b53 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1870,6 +1870,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];
 }
 



More information about the vlc-commits mailing list