[Mplayer-cvslog] CVS: main/libvo vo_3dfx.c,1.5,1.6 vo_gl.c,1.6,1.7 vo_x11.c,1.22,1.23 vo_xmga.c,1.22,1.23 vo_xv.c,1.21,1.22 x11_common.c,1.22,1.23 x11_common.h,1.6,1.7

GEREOFFY arpi_esp at users.sourceforge.net
Sun Jun 17 03:22:11 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv20967

Modified Files:
	vo_3dfx.c vo_gl.c vo_x11.c vo_xmga.c vo_xv.c x11_common.c 
	x11_common.h 
Log Message:
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode

Index: vo_3dfx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_3dfx.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** vo_3dfx.c	2001/04/24 11:30:57	1.5
--- vo_3dfx.c	2001/06/17 01:22:09	1.6
***************
*** 189,192 ****
--- 189,193 ----
  	mywindow = XCreateWindow(display, RootWindow(display,screen),
  				 hint.x, hint.y, hint.width, hint.height, 4, bpp,CopyFromParent,vinfo.visual,xswamask,&xswa);
+ 	vo_x11_classhint( display,mywindow,"3dfx" );
  
  	XSelectInput(display, mywindow, StructureNotifyMask);

Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** vo_gl.c	2001/06/12 14:03:18	1.6
--- vo_gl.c	2001/06/17 01:22:09	1.7
***************
*** 184,187 ****
--- 184,189 ----
    mywindow = XCreateWindow(mydisplay, RootWindow(mydisplay,screen),
      hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa);
+ 
+   vo_x11_classhint( mydisplay,mywindow,"gl" );
    vo_hidecursor(mydisplay,mywindow);
  

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** vo_x11.c	2001/06/12 14:09:25	1.22
--- vo_x11.c	2001/06/17 01:22:09	1.23
***************
*** 118,121 ****
--- 118,122 ----
  // int screen;
   int fullscreen=0;
+  int vm=0;
  // int interval, prefer_blank, allow_exp, nothing;
   unsigned int fg,bg;
***************
*** 142,150 ****
   hint.height=image_height;
   
!  if( flags&0x01 ) fullscreen = 1;
   if( flags&0x08 ) Flip_Flag = 1;
  
  #ifdef HAVE_XF86VM
!  if (fullscreen) {
      unsigned int modeline_width, modeline_height, vm_event, vm_error;
      unsigned int vm_ver, vm_rev;
--- 143,152 ----
   hint.height=image_height;
   
!  if( flags&0x03 ) fullscreen = 1;
!  if( flags&0x02 ) vm = 1;
   if( flags&0x08 ) Flip_Flag = 1;
  
  #ifdef HAVE_XF86VM
!  if (vm) {
      unsigned int modeline_width, modeline_height, vm_event, vm_error;
      unsigned int vm_ver, vm_rev;
***************
*** 222,225 ****
--- 224,228 ----
                           hint.width,hint.height,
                           xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
+  vo_x11_classhint( mDisplay,mywindow,"x11" );
   vo_hidecursor(mDisplay,mywindow);
  
***************
*** 316,320 ****
    bpp=myximage->bits_per_pixel;
  
!   printf( "X11 color mask:  R:%lX  G:%lX  B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask );
  
    // If we have blue in the lowest bit then obviously RGB
--- 319,323 ----
    bpp=myximage->bits_per_pixel;
  
! //  printf( "X11 color mask:  R:%lX  G:%lX  B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask );
  
    // If we have blue in the lowest bit then obviously RGB
***************
*** 326,331 ****
  #endif
    {
!    printf( "No support fon non-native XImage byte order!\n" );
!    return -1;
    }
  
--- 329,335 ----
  #endif
    {
!     mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_BGR : MODE_RGB;
! //   printf( "No support fon non-native XImage byte order!\n" );
! //   return -1;
    }
  

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** vo_xmga.c	2001/06/01 16:38:42	1.22
--- vo_xmga.c	2001/06/17 01:22:09	1.23
***************
*** 274,277 ****
--- 274,278 ----
       InputOutput,
       vinfo.visual,xswamask,&xWAttribs );
+    vo_x11_classhint( mDisplay,mWindow,"xmga" );
     vo_hidecursor(mDisplay,mWindow);
  

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** vo_xv.c	2001/05/31 22:32:58	1.21
--- vo_xv.c	2001/06/17 01:22:09	1.22
***************
*** 142,145 ****
--- 142,146 ----
     hint.x, hint.y, hint.width, hint.height,
     0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+    vo_x11_classhint( mDisplay,mywindow,"xv" );
     vo_hidecursor(mDisplay,mywindow);
  

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** x11_common.c	2001/06/12 14:03:18	1.22
--- x11_common.c	2001/06/17 01:22:09	1.23
***************
*** 50,53 ****
--- 50,54 ----
  // int       mScreen;
   int bpp;
+  unsigned int mask;
  // char    * DisplayName = ":0.0";
  // Display * mDisplay;
***************
*** 79,88 ****
     mXImage=XGetImage( mDisplay,mRootWin,0,0,1,1,AllPlanes,ZPixmap );
     bpp=mXImage->bits_per_pixel;
     XDestroyImage( mXImage );
-  if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi
  // XCloseDisplay( mDisplay );
  #warning Better local display detection method is needed. 
   if (*mDisplayName==':') mLocalDisplay=1; else mLocalDisplay=0;
!  printf("X11 running at %dx%d depth: %d (\"%s\" => %s display)\n",vo_screenwidth,vo_screenheight,vo_depthonscreen,mDisplayName,mLocalDisplay?"local":"remote");
   return 1;
  }
--- 80,96 ----
     mXImage=XGetImage( mDisplay,mRootWin,0,0,1,1,AllPlanes,ZPixmap );
     bpp=mXImage->bits_per_pixel;
+    if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi
+    mask=mXImage->red_mask|mXImage->green_mask|mXImage->blue_mask;
+    printf("vo: X11 color mask:  %X  (R:%lX G:%lX B:%lX)\n",
+      mask,mXImage->red_mask,mXImage->green_mask,mXImage->blue_mask);
+    if(((vo_depthonscreen+7)/8)==2){
+      if(mask==0x7FFF) vo_depthonscreen=15; else
+      if(mask==0xFFFF) vo_depthonscreen=16;
+    }
     XDestroyImage( mXImage );
  // XCloseDisplay( mDisplay );
  #warning Better local display detection method is needed. 
   if (*mDisplayName==':') mLocalDisplay=1; else mLocalDisplay=0;
!  printf("vo: X11 running at %dx%d depth: %d (\"%s\" => %s display)\n",vo_screenwidth,vo_screenheight,vo_depthonscreen,mDisplayName,mLocalDisplay?"local":"remote");
   return 1;
  }
***************
*** 150,153 ****
--- 158,169 ----
  void vo_x11_decoration( Display * vo_Display,Window w,int d )
  {
+ 
+ #if 1
+     XSetWindowAttributes attr;
+     attr.override_redirect = True;
+     XChangeWindowAttributes(vo_Display, w, CWOverrideRedirect, &attr);
+ //    XMapWindow(vo_Display], w);
+ #endif
+ 
   vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
   if ( vo_MotifHints != None )
***************
*** 158,161 ****
--- 174,184 ----
                      PropModeReplace,(unsigned char *)&vo_MotifWmHints,4 );
    }
+ }
+ 
+ void vo_x11_classhint( Display * display,Window window,char *name ){
+ 	    XClassHint wmClass;
+ 	    wmClass.res_name = name;
+ 	    wmClass.res_class = "MPlayer";
+ 	    XSetClassHint(display,window,&wmClass);
  }
  

Index: x11_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** x11_common.h	2001/05/31 22:32:58	1.6
--- x11_common.h	2001/06/17 01:22:09	1.7
***************
*** 17,20 ****
--- 17,21 ----
  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 );
  int vo_x11_check_events(Display *mydisplay);
  #endif


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list