[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.94,1.95 vo_xmga.c,1.58,1.59 vo_xv.c,1.75,1.76 x11_common.c,1.66,1.67 x11_common.h,1.18,1.19

Zoltan Ponekker pontscho at mplayerhq.hu
Thu Apr 25 23:52:50 CEST 2002


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

Modified Files:
	vo_x11.c vo_xmga.c vo_xv.c x11_common.c x11_common.h 
Log Message:
fix fullscreen (?)

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- vo_x11.c	24 Apr 2002 23:10:41 -0000	1.94
+++ vo_x11.c	25 Apr 2002 21:52:47 -0000	1.95
@@ -362,7 +362,7 @@
     vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
 
     // we cannot grab mouse events on root window :(
-    XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | 
+    XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask |
 	((WinID==0)?0:(ButtonPressMask | ButtonReleaseMask | PointerMotionMask)) );
 
 #ifdef HAVE_XF86VM

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- vo_xmga.c	24 Apr 2002 23:15:17 -0000	1.58
+++ vo_xmga.c	25 Apr 2002 21:52:47 -0000	1.59
@@ -278,7 +278,7 @@
    xWAttribs.colormap=XCreateColormap( mDisplay,RootWindow( mDisplay,mScreen ),vinfo.visual,AllocNone );
    xWAttribs.background_pixel=0;
    xWAttribs.border_pixel=0;
-   xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask | 
+   xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask | PropertyChangeMask |
        ((WinID==0)?0:(ButtonPressMask | ButtonReleaseMask | PointerMotionMask));
    xswamask=CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
 
@@ -296,7 +296,6 @@
      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 );
 

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- vo_xv.c	24 Apr 2002 23:10:41 -0000	1.75
+++ vo_xv.c	25 Apr 2002 21:52:47 -0000	1.76
@@ -416,7 +416,7 @@
    vo_x11_classhint( mDisplay,vo_window,"xv" );
    vo_hidecursor(mDisplay,vo_window);
 
-   XSelectInput(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | 
+   XSelectInput(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | PropertyChangeMask |
 	((WinID==0) ? 0 : (PointerMotionMask
 #ifdef HAVE_NEW_INPUT
 		| ButtonPressMask | ButtonReleaseMask

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- x11_common.c	17 Apr 2002 18:35:19 -0000	1.66
+++ x11_common.c	25 Apr 2002 21:52:47 -0000	1.67
@@ -453,6 +453,7 @@
 
        int vo_mouse_timer_const = 30;
 static int vo_mouse_counter = 30;
+       int vo_wm_type = 1;
 
 int vo_x11_check_events(Display *mydisplay){
  int ret=0;
@@ -497,8 +498,9 @@
 		&vo_dx, &vo_dy, (Window *)&foo);
 	    }
 #endif
-	   if (verbose)
+//	   if (verbose)
 	    printf("X11 Window %dx%d-%dx%d\n", vo_dx, vo_dy, vo_dwidth, vo_dheight);
+	    printf("============================================================\n" );
            ret|=VO_EVENT_RESIZE;
            break;
       case KeyPress:
@@ -539,32 +541,42 @@
            mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1);
            break;
 #endif
+      case PropertyNotify: 
+	   if ( !strcmp( XGetAtomName( mydisplay,Event.xproperty.atom ),"_ICEWM_TRAY" ) ||
+		!strncmp( XGetAtomName( mydisplay,Event.xproperty.atom ),"_KDE_",5 ) ||
+	        !strcmp( XGetAtomName( mydisplay,Event.xproperty.atom ),"KWM_WIN_DESKTOP" ) ) vo_wm_type=0;
+		
+ 	     fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",
+	      vo_window,XGetAtomName( mydisplay,Event.xproperty.atom ),Event.xproperty.atom );
+
+	   break;
      }
   }
 
   return ret;
 }
 
-void vo_x11_sizehint( int x, int y, int width, int height )
+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 | PBaseSize;
  vo_hint.x=x; vo_hint.y=y; vo_hint.width=width; vo_hint.height=height;
+ if ( max )
+  {
+   vo_hint.max_width=width; vo_hint.max_height=height;
+   vo_hint.flags|=PMaxSize;
+  } else { vo_hint.max_width=0; vo_hint.max_height=0; }
+ vo_hint.base_width=width; vo_hint.base_height=height;
  vo_hint.win_gravity=StaticGravity;
  XSetWMNormalHints( mDisplay,vo_window,&vo_hint );
 }
 
 void vo_x11_fullscreen( void )
 {
- XUnmapWindow( mDisplay,vo_window );
+ if ( vo_wm_type ) XUnmapWindow( mDisplay,vo_window );
  if ( !vo_fs )
   {
    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 );
   }
@@ -574,10 +586,12 @@
     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 );
    }
- vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight );
+ vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
  XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
- XMapWindow( mDisplay,vo_window );
- XSync( mDisplay,False );
+ XMapRaised( mDisplay,vo_window );
+ 
+ XRaiseWindow( mDisplay,vo_window );
+ XFlush( mDisplay );
 }
 
 void saver_on(Display *mDisplay) {

Index: x11_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- x11_common.h	16 Apr 2002 17:41:29 -0000	1.18
+++ x11_common.h	25 Apr 2002 21:52:47 -0000	1.19
@@ -28,7 +28,7 @@
 extern void vo_showcursor( Display *disp, Window win );
 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 );
+void vo_x11_sizehint( int x, int y, int width, int height, int max );
 int vo_x11_check_events(Display *mydisplay);
 void vo_x11_fullscreen( void );
 #endif




More information about the MPlayer-cvslog mailing list