# HG changeset patch # User nplourde # Date 1120082088 0 # Node ID 1ca8b5873c3f8c9cbeea59a030323383b7b8dc13 # Parent df539b2f5f4ff0d46b950591f9070ce77c0bea64 keep window size when changing aspect diff -r df539b2f5f4f -r 1ca8b5873c3f libvo/vo_macosx.h --- a/libvo/vo_macosx.h Wed Jun 29 21:49:58 2005 +0000 +++ b/libvo/vo_macosx.h Wed Jun 29 21:54:48 2005 +0000 @@ -31,6 +31,7 @@ GLfloat upperLeft[2]; BOOL mouseHide; + float winSizeMult; //menu command id NSMenuItem *kQuitCmd; diff -r df539b2f5f4f -r 1ca8b5873c3f libvo/vo_macosx.m --- a/libvo/vo_macosx.m Wed Jun 29 21:49:58 2005 +0000 +++ b/libvo/vo_macosx.m Wed Jun 29 21:54:48 2005 +0000 @@ -288,6 +288,7 @@ [window setTitle:@"MPlayer - The Movie Player"]; isFullscreen = 0; + winSizeMult = 1; } - (id) config @@ -359,7 +360,7 @@ kDoubleScreenCmd = menuItem; menuItem = [[NSMenuItem alloc] initWithTitle:@"Full Size" action:@selector(menuAction:) keyEquivalent:@"f"]; [menu addItem:menuItem]; kFullScreenCmd = menuItem; - menuItem = (NSMenuItem *)[NSMenuItem separatorItem]; [menu addItem:menuItem]; + //menuItem = (NSMenuItem *)[NSMenuItem separatorItem]; [menu addItem:menuItem]; NSMenu *aspectMenu; aspectMenu = [[NSMenu alloc] initWithTitle:@"Aspect Ratio"]; @@ -424,8 +425,9 @@ vo_fs = (!(vo_fs)); [self fullscreen:YES]; } - frame.size.width = (d_width/2); - frame.size.height = ((d_width/movie_aspect)/2); + winSizeMult = 0.5; + frame.size.width = (d_width*winSizeMult); + frame.size.height = ((d_width/movie_aspect)*winSizeMult); [window setContentSize: frame.size]; [self reshape]; } @@ -435,6 +437,7 @@ vo_fs = (!(vo_fs)); [self fullscreen:YES]; } + winSizeMult = 1; frame.size.width = d_width; frame.size.height = d_width/movie_aspect; [window setContentSize: frame.size]; @@ -446,8 +449,9 @@ vo_fs = (!(vo_fs)); [self fullscreen:YES]; } - frame.size.width = d_width*2; - frame.size.height = (d_width/movie_aspect)*2; + winSizeMult = 2; + frame.size.width = d_width*winSizeMult; + frame.size.height = (d_width/movie_aspect)*winSizeMult; [window setContentSize: frame.size]; [self reshape]; } @@ -478,8 +482,8 @@ if(sender == kAspectOrgCmd) { movie_aspect = old_movie_aspect; - frame.size.width = d_width; - frame.size.height = d_width/movie_aspect; + frame.size.width = d_width*winSizeMult; + frame.size.height = (d_width/movie_aspect)*winSizeMult; [window setContentSize: frame.size]; [self reshape]; } @@ -487,8 +491,8 @@ if(sender == kAspectFullCmd) { movie_aspect = 4.0f/3.0f; - frame.size.width = d_width; - frame.size.height = d_width/movie_aspect; + frame.size.width = d_width*winSizeMult; + frame.size.height = (d_width/movie_aspect)*winSizeMult; [window setContentSize: frame.size]; [self reshape]; } @@ -496,8 +500,8 @@ if(sender == kAspectWideCmd) { movie_aspect = 16.0f/9.0f; - frame.size.width = d_width; - frame.size.height = d_width/movie_aspect; + frame.size.width = d_width*winSizeMult; + frame.size.height = (d_width/movie_aspect)*winSizeMult; [window setContentSize: frame.size]; [self reshape]; }