[Mplayer-cvslog] CVS: main/libvo x11_common.c,1.166,1.167

Adam Tla/lka CVS syncmail at mplayerhq.hu
Fri Apr 2 08:05:56 CEST 2004


CVS change done by Adam Tla/lka CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv2531/libvo

Modified Files:
	x11_common.c 
Log Message:
win_gravity memorizing and restoring while switching fullscreen mode


Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -r1.166 -r1.167
--- x11_common.c	1 Apr 2004 20:59:07 -0000	1.166
+++ x11_common.c	2 Apr 2004 06:05:54 -0000	1.167
@@ -59,6 +59,7 @@
  
 int fs_layer=WIN_LAYER_ABOVE_DOCK;
 static int orig_layer=0;
+static int old_gravity = NorthWestGravity;
 
 int stop_xscreensaver=0;
 
@@ -620,7 +621,6 @@
   if(vo_fsmode&8){
     XSetTransientForHint (vo_Display, w, RootWindow(vo_Display,mScreen));
   }
-
  vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
  if ( vo_MotifHints != None )
   {
@@ -810,6 +810,10 @@
 	    XFree( name );
 	   }
 	   break;
+      case MapNotify:
+		vo_hint.win_gravity = old_gravity;
+		XSetWMNormalHints( mDisplay,vo_window,&vo_hint );
+	   break;
      }
   }
   return ret;
@@ -817,7 +821,8 @@
 
 void vo_x11_sizehint( int x, int y, int width, int height, int max )
 {
- vo_hint.flags=PPosition | PSize | PWinGravity;
+   vo_hint.flags=PPosition | PSize | PWinGravity;
+
  if(vo_x11_keepaspect)
  {
  	vo_hint.flags |= PAspect;
@@ -839,7 +844,7 @@
  vo_hint.min_width = vo_hint.min_height = 4; 
  vo_hint.flags |= PMinSize;
 
- vo_hint.win_gravity=StaticGravity;
+ vo_hint.win_gravity= StaticGravity;
  XSetWMNormalHints( mDisplay,vo_window,&vo_hint );
 }
 
@@ -1066,16 +1071,25 @@
    vo_fs=VO_TRUE;
    vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight;
    x=0; y=0; w=vo_screenwidth; h=vo_screenheight;
+ 
+ }
+ {
+	long dummy;
+	XGetWMNormalHints(mDisplay, vo_window, &vo_hint, &dummy);
+	if (!(vo_hint.flags & PWinGravity))
+		old_gravity = NorthWestGravity;
+	else
+		old_gravity = vo_hint.win_gravity;
  }
  vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 0 : 1 );
- vo_x11_sizehint( x,y,w,h,0 );
+ vo_x11_sizehint( x,y,w,h,0);
  vo_x11_setlayer( mDisplay,vo_window,vo_fs );
 
  if ((!(vo_fs)) & vo_ontop) vo_x11_setlayer(mDisplay, vo_window,vo_ontop);
 
- if(vo_wm_type==0 && !(vo_fsmode&16))
+if(vo_wm_type==0 && !(vo_fsmode&16))
 //    XUnmapWindow( mDisplay,vo_window );  // required for MWM
-      XWithdrawWindow(mDisplay,vo_window,mScreen);
+     XWithdrawWindow(mDisplay,vo_window,mScreen);
  XMoveResizeWindow( mDisplay,vo_window,x,y,w,h );
 #ifdef HAVE_XINERAMA
  vo_x11_xinerama_move(mDisplay,vo_window);




More information about the MPlayer-cvslog mailing list