[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.82,1.83 vo_xmga.c,1.51,1.52 vo_xv.c,1.61,1.62 x11_common.c,1.56,1.57 x11_common.h,1.16,1.17

Zoltan Ponekker pontscho at mplayer.dev.hu
Fri Mar 8 21:14:19 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv2241/libvo

Modified Files:
	vo_x11.c vo_xmga.c vo_xv.c x11_common.c x11_common.h 
Log Message:
small changes in libvo's X11 support

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- vo_x11.c	1 Mar 2002 12:42:12 -0000	1.82
+++ vo_x11.c	8 Mar 2002 20:14:08 -0000	1.83
@@ -584,6 +584,8 @@
   case VOCTRL_GUISUPPORT:
     return VO_TRUE;
   case VOCTRL_FULLSCREEN:
+    vo_x11_fullscreen();
+/*
     if ((vo_fs_oldwidth == -1) && (vo_fs_oldheight == -1))
     {
 	int foo;
@@ -605,7 +607,7 @@
 	mp_msg(MSGT_VO,MSGL_V,"X11 Fullscreen: saved old place: %dx%d-%dx%d\n",
 	    vo_fs_oldx, vo_fs_oldy, vo_fs_oldwidth, vo_fs_oldheight);
 	
-	/* resize */
+	// resize 
 	vo_dwidth = vo_screenwidth;
 	vo_dheight = vo_screenheight;
 	vo_x11_decoration( mDisplay,vo_window,0 );
@@ -621,16 +623,17 @@
 	
 
 #ifdef LOCAL_LOOKUP
-	/* restore */
+	// restore 
 	vo_dwidth = vo_fs_oldwidth;
 	vo_dheight = vo_fs_oldheight;
 #endif
 	
-	/* clean */
+	// clean
 	vo_fs_oldwidth = -1;
 	vo_fs_oldheight = -1;
 	XSync(mDisplay, False);
     }
+*/
     return VO_TRUE;
   }
   return VO_NOTIMPL;

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- vo_xmga.c	7 Mar 2002 20:14:52 -0000	1.51
+++ vo_xmga.c	8 Mar 2002 20:14:08 -0000	1.52
@@ -61,7 +61,7 @@
 
 static vo_info_t vo_info =
 {
- "X11 (Matrox G200/G400 overlay in window using /dev/mga_vid)",
+ "X11 (Matrox G200/G4x0/G550 overlay in window using /dev/mga_vid)",
  "xmga",
  "Zoltan Ponekker <pontscho at makacs.poliod.hu>",
  ""
@@ -90,10 +90,6 @@
 static uint32_t               drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth;
 static uint32_t               drwcX,drwcY,dwidth,dheight;
 
-//#ifdef HAVE_NEW_GUI
- static uint32_t               mdwidth,mdheight;
-//#endif
-
 static XSetWindowAttributes   xWAttribs;
 
 #define VO_XMGA
@@ -111,14 +107,8 @@
 
 static void set_window(){
 
-         dwidth=mdwidth; dheight=mdheight;
-         if ( vo_fs )
-	  {
-	   dwidth=vo_screenwidth;
-	   dheight=vo_screenwidth * mdheight / mdwidth;
-	  }
-
          XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
+         fprintf( stderr,"[xmga] x: %d y: %d w: %d h: %d\n",drwX,drwY,drwWidth,drwHeight );
          drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight;
          XTranslateCoordinates( mDisplay,vo_window,mRoot,0,0,&drwcX,&drwcY,&mRoot );
          fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
@@ -273,7 +263,6 @@
 
   aspect(&d_width,&d_height,A_NOZOOM);
 #ifdef HAVE_NEW_GUI
- mdwidth=width; mdheight=height;
  if ( vo_window == None )
   {
 #endif
@@ -311,15 +300,10 @@
      vinfo.visual,xswamask,&xWAttribs );
    vo_x11_classhint( mDisplay,vo_window,"xmga" );
    vo_hidecursor(mDisplay,vo_window);
+   vo_x11_sizehint( wndX,wndY,wndWidth,wndHeight );
 
    if ( vo_fs ) vo_x11_decoration( mDisplay,vo_window,0 );
 
-   XGetNormalHints( mDisplay,vo_window,&hint );
-   hint.x=wndX; hint.y=wndY;
-   hint.width=wndWidth; hint.height=wndHeight;
-   hint.base_width=wndWidth; hint.base_height=wndHeight;
-   hint.flags=USPosition | USSize;
-   XSetNormalHints( mDisplay,vo_window,&hint );
    XStoreName( mDisplay,vo_window,mTitle );
    XMapWindow( mDisplay,vo_window );
 		   

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- vo_xv.c	7 Mar 2002 17:50:25 -0000	1.61
+++ vo_xv.c	8 Mar 2002 20:14:08 -0000	1.62
@@ -94,10 +94,6 @@
 static uint32_t               drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth;
 static uint32_t               drwcX,drwcY,dwidth,dheight;
 
-#ifdef HAVE_NEW_GUI
- static uint32_t               mdwidth,mdheight;
-#endif
-
 static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
 
 static void draw_alpha_yv12(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
@@ -336,11 +332,6 @@
  image_width = width;
  image_format=format;
 
-#ifdef HAVE_NEW_GUI
- mdwidth=width;
- mdheight=height;
-#endif
-
  vo_fs=flags&1;
  if ( vo_fs )
   { vo_old_width=d_width; vo_old_height=d_height; }
@@ -500,17 +491,6 @@
 
      current_buf=0;
 
-#ifdef HAVE_NEW_GUI
-      if ( vo_window != None )
-       {
-        dwidth=mdwidth; dheight=mdheight;
-        if ( vo_fs )
-         {
-          dwidth=vo_screenwidth;
-          dheight=vo_screenwidth * mdheight / mdwidth;
-         }
-       }
-#endif
      set_gamma_correction();
 
      XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
@@ -581,15 +561,6 @@
    drwX=0; drwY=0;
    XTranslateCoordinates( mDisplay,vo_window,mRoot,0,0,&drwcX,&drwcY,&mRoot );
    printf( "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
-
-   #ifdef HAVE_NEW_GUI
-    dwidth=mdwidth; dheight=mdheight;
-    if ( vo_fs )
-     {
-      dwidth=vo_screenwidth;
-      dheight=vo_screenwidth * mdheight / mdwidth;
-     }
-   #endif
 
    aspect(&dwidth,&dheight,A_NOZOOM);
    if ( vo_fs )

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- x11_common.c	7 Mar 2002 17:50:25 -0000	1.56
+++ x11_common.c	8 Mar 2002 20:14:08 -0000	1.57
@@ -397,9 +397,16 @@
   {
    memset( &vo_MotifWmHints,0,sizeof( MotifWmHints ) );
    vo_MotifWmHints.flags=MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
-   vo_MotifWmHints.functions=MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE;
-   if ( d ) d=MWM_DECOR_ALL;
+   if ( d )
+    {
+     vo_MotifWmHints.functions=MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE;
+     d=MWM_DECOR_ALL;
+    }
+#if 0
    vo_MotifWmHints.decorations=d|((vo_fsmode&2)?0:MWM_DECOR_MENU);
+#else
+   vo_MotifWmHints.decorations=d|((vo_fsmode&2)?MWM_DECOR_MENU:0);
+#endif
    XChangeProperty( vo_Display,w,vo_MotifHints,vo_MotifHints,32,
                     PropModeReplace,(unsigned char *)&vo_MotifWmHints,(vo_fsmode&4)?4:5 );
   }
@@ -412,8 +419,9 @@
 	    XSetClassHint(display,window,&wmClass);
 }
 
-Window    vo_window = None;
-GC        vo_gc;
+Window     vo_window = None;
+GC         vo_gc;
+XSizeHints vo_hint;
 
 #ifdef HAVE_NEW_GUI
  void vo_setwindow( Window w,GC g ) {
@@ -509,6 +517,14 @@
   return ret;
 }
 
+void vo_x11_sizehint( int x, int y, int width, int height )
+{
+ vo_hint.flags=PPosition | PSize | PWinGravity;
+ vo_hint.x=x; vo_hint.y=y; vo_hint.width=width; vo_hint.height=height;
+ vo_hint.win_gravity=StaticGravity;
+ XSetWMNormalHints( mDisplay,vo_window,&vo_hint );
+}
+
 void vo_x11_fullscreen( void )
 {
  XUnmapWindow( mDisplay,vo_window );
@@ -516,6 +532,11 @@
   {
    vo_fs=VO_TRUE;
    vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth;   vo_old_height=vo_dheight;
+   {
+    Window root; int foo, foo2;
+//    XGetGeometry( mDisplay,vo_window,&root,&vo_old_x,&vo_old_y,&vo_old_width,vo_old_height,&foo,&foo2 );
+//    XTranslateCoordinates( mDisplay,vo_window,root,0,0,&vo_old_x,&vo_old_y,(Window *)&foo);
+   }
    vo_dx=0;        vo_dy=0;        vo_dwidth=vo_screenwidth; vo_dheight=vo_screenheight;
    vo_x11_decoration( mDisplay,vo_window,0 );
   }
@@ -525,9 +546,10 @@
     vo_dx=vo_old_x; vo_dy=vo_old_y; vo_dwidth=vo_old_width; vo_dheight=vo_old_height;
     vo_x11_decoration( mDisplay,vo_window,1 );
    }
- XMapWindow( mDisplay,vo_window );
+ vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight );
  XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
- return;
+ XMapWindow( mDisplay,vo_window );
+ XSync( mDisplay,False );
 }
 
 void saver_on(Display *mDisplay) {

Index: x11_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- x11_common.h	7 Mar 2002 17:50:25 -0000	1.16
+++ x11_common.h	8 Mar 2002 20:14:08 -0000	1.17
@@ -4,6 +4,9 @@
 
 #ifdef X11_FULLSCREEN
 
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
 extern int vo_depthonscreen;
 extern int vo_screenwidth;
 extern int vo_screenheight;
@@ -22,12 +25,14 @@
 int vo_hidecursor ( Display* , Window );
 void vo_x11_decoration( Display * vo_Display,Window w,int d );
 void vo_x11_classhint( Display * display,Window window,char *name );
+void vo_x11_sizehint( int x, int y, int width, int height );
 int vo_x11_check_events(Display *mydisplay);
 void vo_x11_fullscreen( void );
 #endif
 
-extern Window    vo_window;
-extern GC        vo_gc;
+extern Window     vo_window;
+extern GC         vo_gc;
+extern XSizeHints vo_hint;
 
 #ifdef HAVE_NEW_GUI
  extern void vo_setwindow( Window w,GC g );




More information about the MPlayer-cvslog mailing list