changeset 8692:604f0cde816c

X11 window aspect patch by Arnaud Boulan <boulan@iie.cnam.fr> adds 2 options: -keepaspect (default) and -nokeepaspect tested with icewm and enlightenment
author attila
date Wed, 01 Jan 2003 12:02:49 +0000
parents b78e116487e8
children e11bcd3b638b
files DOCS/mplayer.1 cfg-mplayer.h libvo/vo_xv.c libvo/x11_common.c
diffstat 4 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/mplayer.1	Wed Jan 01 11:38:00 2003 +0000
+++ b/DOCS/mplayer.1	Wed Jan 01 12:02:49 2003 +0000
@@ -1376,6 +1376,12 @@
 .B \-nograbpointer
 Do not grab mouse pointer after VidMode change (\-vm), useful for multihead
 setup.
+
+.TP
+.B \-nokeepaspect
+Do not keep window aspect ratio when resizing X11 windows.
+(works currently only with \-vo x11, xv, xmga and xvidix)
+
 .TP
 .B \-noslices
 Disable drawing video by 16-pixel height slices/\:bands, instead draws the
--- a/cfg-mplayer.h	Wed Jan 01 11:38:00 2003 +0000
+++ b/cfg-mplayer.h	Wed Jan 01 12:02:49 2003 +0000
@@ -82,6 +82,7 @@
 extern int WinID;
 extern int ice_layer;
 extern int stop_xscreensaver;
+extern int vo_x11_keepaspect;
 #endif
 
 #ifdef HAVE_AA
@@ -294,6 +295,8 @@
 	{"icelayer", &ice_layer, CONF_TYPE_INT, CONF_RANGE, 0, 15, NULL},
 	{"stop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"nostop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+	{"keepaspect", &vo_x11_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"nokeepaspect", &vo_x11_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 #endif
 
 #ifdef HAVE_XINERAMA
--- a/libvo/vo_xv.c	Wed Jan 01 11:38:00 2003 +0000
+++ b/libvo/vo_xv.c	Wed Jan 01 12:02:49 2003 +0000
@@ -387,6 +387,8 @@
     } else 
        if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
 
+    vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );   
+ 
     if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc );
     vo_gc = XCreateGC(mDisplay, vo_window, 0L, &xgcv);
     XFlush(mDisplay);
--- a/libvo/x11_common.c	Wed Jan 01 11:38:00 2003 +0000
+++ b/libvo/x11_common.c	Wed Jan 01 12:02:49 2003 +0000
@@ -80,6 +80,7 @@
 static int vo_old_width = 0;
 static int vo_old_height = 0;
 
+int vo_x11_keepaspect = 1;
 
 #ifdef HAVE_XINERAMA
 int xinerama_screen = 0;
@@ -656,6 +657,15 @@
 void vo_x11_sizehint( int x, int y, int width, int height, int max )
 {
  vo_hint.flags=PPosition | PSize | PWinGravity;
+ if(vo_x11_keepaspect)
+ {
+ 	vo_hint.flags |= PAspect;
+	vo_hint.min_aspect.x = width;
+	vo_hint.min_aspect.y = height;
+	vo_hint.max_aspect.x = width;
+	vo_hint.max_aspect.y = height;
+  }
+
  vo_hint.x=x; vo_hint.y=y; vo_hint.width=width; vo_hint.height=height;
  if ( max )
   {