[Mplayer-cvslog] CVS: main/libvo x11_common.c,1.51,1.52

Alex Beregszaszi alex at mplayer.dev.hu
Fri Feb 22 20:36:24 CET 2002


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

Modified Files:
	x11_common.c 
Log Message:
setting vo_dx and vo_dy in event handling

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- x11_common.c	21 Feb 2002 22:48:47 -0000	1.51
+++ x11_common.c	22 Feb 2002 19:36:21 -0000	1.52
@@ -47,7 +47,7 @@
 #define	SCAN_VISUALS
 
 
-extern verbose;
+extern int verbose;
 
 static int dpms_disabled=0;
 static int timeout_save=0;
@@ -144,7 +144,7 @@
 #define MSGLEN 60
     char msg[MSGLEN];
         
-    XGetErrorText(display, event->error_code, &msg, MSGLEN);
+    XGetErrorText(display, event->error_code, (char *)&msg, MSGLEN);
     
     printf("X11 error: %s\n", msg);
     
@@ -173,9 +173,18 @@
 
  if(vo_depthonscreen) return 1; // already called
 
+ XSetErrorHandler(x11_errorhandler);
+
+#if 0
  if (!mDisplayName)
    if (!(mDisplayName=getenv("DISPLAY")))
      mDisplayName=strdup(":0.0");
+#else
+ mDisplayName = XDisplayName(mDisplayName);
+#endif
+
+ if (verbose)
+    printf("X11 opening display: %s\n", mDisplayName);
 
  mDisplay=XOpenDisplay(mDisplayName);
  if ( !mDisplay )
@@ -264,8 +273,6 @@
 	vo_screenwidth,vo_screenheight,
 	depth, vo_depthonscreen,
 	mDisplayName,mLocalDisplay?"local":"remote");
-
- XSetErrorHandler(x11_errorhandler);
  
  return 1;
 }
@@ -445,6 +452,22 @@
       case ConfigureNotify:
            vo_dwidth=Event.xconfigure.width;
            vo_dheight=Event.xconfigure.height;
+#if 0
+	   /* when resizing, x and y are zero :( */
+	   vo_dx=Event.xconfigure.x;
+	   vo_dy=Event.xconfigure.y;
+#else
+	   {
+	    Window root;
+	    int foo;
+	    XGetGeometry(mydisplay, vo_window, &root, &foo, &foo, 
+		&foo/*width*/, &foo/*height*/, &foo, &foo);
+	    XTranslateCoordinates(mydisplay, vo_window, root, 0, 0,
+		&vo_dx, &vo_dy, (Window *)&foo);
+	    }
+#endif
+	   if (verbose)
+	    printf("X11 Window %dx%d-%dx%d\n", vo_dx, vo_dy, vo_dwidth, vo_dheight);
            ret|=VO_EVENT_RESIZE;
            break;
       case KeyPress:




More information about the MPlayer-cvslog mailing list