changeset 6013:7f6e02a16ac4

some bugfix, x[11|mga|v] ( fullscreen with more files )
author pontscho
date Wed, 08 May 2002 16:41:44 +0000
parents 89c87be7a248
children 4f0b13262397
files Gui/wm/ws.c configure libvo/vo_x11.c libvo/x11_common.c libvo/x11_common.h mplayer.c
diffstat 6 files changed, 69 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/wm/ws.c	Tue May 07 21:58:01 2002 +0000
+++ b/Gui/wm/ws.c	Wed May 08 16:41:44 2002 +0000
@@ -961,30 +961,30 @@
 // ----------------------------------------------------------------------------------------------
 void wsMoveTopWindow( wsTWindow * win )
 {
- if ( wsWMType == wsWMIceWM )
-  {
-   XUnmapWindow( wsDisplay,win->WindowID );
-   XMapWindow( wsDisplay,win->WindowID );
-   return;
-  }
-/*  
- if ( XInternAtom( wsDisplay,"_NET_ACTIVE_WINDOW",False ) != None )
+ switch ( wsWMType )
   {
-   XEvent e;
-
-   e.xclient.type=ClientMessage;
-   e.xclient.message_type=XInternAtom( wsDisplay,"_NET_ACTIVE_WINDOW",False );
-   e.xclient.display=wsDisplay;
-   e.xclient.window=win->WindowID;
-   e.xclient.format=32;
-   e.xclient.data.l[0]=0;
-   XSendEvent( wsDisplay,wsRootWin,False,SubstructureRedirectMask,&e );
+   case wsWMIceWM:
+	  XUnmapWindow( wsDisplay,win->WindowID );
+	  XMapWindow( wsDisplay,win->WindowID );
+	  break;
+   case wsWMNetWM:
+   case wsWMKDE:
+	 {
+	  XEvent e;
+	  e.xclient.type=ClientMessage;
+	  e.xclient.message_type=XInternAtom( wsDisplay,"_NET_ACTIVE_WINDOW",False );
+	  e.xclient.display=wsDisplay;
+	  e.xclient.window=win->WindowID;
+	  e.xclient.format=32;
+	  e.xclient.data.l[0]=0;
+	  XSendEvent( wsDisplay,wsRootWin,False,SubstructureRedirectMask,&e );
+	  break;
+	 }
+   default:
+         XMapRaised( wsDisplay,win->WindowID );
+	 XRaiseWindow( wsDisplay,win->WindowID );
+         break;
   }
-   else */
-    {
-     XMapRaised( wsDisplay,win->WindowID );
-     XRaiseWindow( wsDisplay,win->WindowID );
-    }
 }
 
 // ----------------------------------------------------------------------------------------------
--- a/configure	Tue May 07 21:58:01 2002 +0000
+++ b/configure	Wed May 08 16:41:44 2002 +0000
@@ -113,6 +113,8 @@
                          data files (fonts, skins) [PREFIX/share/mplayer]
   --confdir=DIR          use this prefix for installing configuration files
                          [same as datadir]
+  --libdir=DIR           use this prefix for object code libraries
+                         [PREFIX/lib]
 
 Optional features:
   --disable-mencoder     disable mencoder [autodetect]
@@ -1066,7 +1068,9 @@
   --confdir=*)
     _confdir=`echo $ac_option | cut -d '=' -f 2`
     ;;
-
+  --libdir=*)
+    _libdir=`echo $ac_option | cut -d '=' -f 2`
+    ;;
 
   *)
     echo "Unknown parameter: $ac_option"
--- a/libvo/vo_x11.c	Tue May 07 21:58:01 2002 +0000
+++ b/libvo/vo_x11.c	Wed May 08 16:41:44 2002 +0000
@@ -45,6 +45,11 @@
 
 #include "../mp_msg.h"
 
+#ifdef HAVE_NEW_GUI
+#include "../Gui/interface.h"
+#include "../mplayer.h"
+#endif
+
 static vo_info_t vo_info =
 {
         "X11 ( XImage/Shm )",
@@ -91,6 +96,9 @@
 static int srcH=-1;
 static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing
 
+static int old_vo_dwidth=-1;
+static int old_vo_dheight=-1;
+
 static void check_events(){
   int ret = vo_x11_check_events(mDisplay);
   
@@ -243,6 +251,9 @@
 
 
  vo_mouse_autohide=1;
+ old_vo_dwidth=-1;
+ old_vo_dheight=-1;
+
  if (!title)
     title = strdup("MPlayer X11 (XImage/Shm) render");
 
@@ -260,7 +271,7 @@
  
 //printf( "w: %d h: %d\n\n",vo_dwidth,vo_dheight );
 
- XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs );
+ XGetWindowAttributes( mDisplay,mRootWin,&attribs );
  depth=attribs.depth;
 
  if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24;
@@ -275,18 +286,19 @@
  aspect= ((1<<16)*d_width + d_height/2)/d_height;
 
 #ifdef HAVE_NEW_GUI
- if ( vo_window == None )
+ if(use_gui) guiGetEvent( guiSetShVideo,0 ); // the GUI will set up / resize the window
+  else
 #endif   
    {
     hint.x=0;
     hint.y=0;
-    if(zoomFlag){
-	hint.width=d_width;
-	hint.height=d_height;
-    }else{
-	hint.width=width;
-	hint.height=height;
-    }
+//    if(zoomFlag){
+//	hint.width=d_width;
+//	hint.height=d_height;
+//    }else{
+//	hint.width=width;
+//	hint.height=height;
+//    }
  
 #ifdef HAVE_XF86VM
     if ( vm )
@@ -468,8 +480,6 @@
 {
   uint8_t *dst[3];
   int dstStride[3];
-  static int old_vo_dwidth=-1;
-  static int old_vo_dheight=-1;
   
   if((old_vo_dwidth != vo_dwidth || old_vo_dheight != vo_dheight) /*&& y==0*/ && zoomFlag)
   {
@@ -602,6 +612,7 @@
  vo_vm_close(mDisplay);
 #endif
 
+ zoomFlag=0;
  vo_x11_uninit(mDisplay, vo_window);
 
  freeSwsContext(swsContext);
@@ -616,7 +627,7 @@
     }
 
 #ifdef HAVE_NEW_GUI
-    if ( vo_window == None )
+    if ( !use_gui )
 #endif   
 	if( !vo_init() ) return -1; // Can't open X11
 
--- a/libvo/x11_common.c	Tue May 07 21:58:01 2002 +0000
+++ b/libvo/x11_common.c	Wed May 08 16:41:44 2002 +0000
@@ -37,6 +37,7 @@
 
 #ifdef HAVE_NEW_GUI
 #include "../Gui/interface.h"
+#include "../mplayer.h"
 #endif
 
 /*
@@ -355,6 +356,12 @@
  return 1;
 }
 
+void vo_uninit( void )
+{
+ printf("vo: uninit ...\n" );
+ if( !vo_depthonscreen ) return;
+ XCloseDisplay( mDisplay );
+}
 
 #include "../linux/keycodes.h"
 #include "wskeys.h"
@@ -507,14 +514,14 @@
 
 #ifdef HAVE_NEW_GUI
     /* destroy window only if it's not controlled by GUI */
-    if (vo_window == None)
+    if ( !use_gui )
 #endif
     {
 	/* and -wid is set */
 	if (!(WinID > 0))
 	    XDestroyWindow(display, window);
-	XCloseDisplay(display);
 	vo_depthonscreen = 0;
+	vo_fs=0;
     }
     return(1);
 }
@@ -721,7 +728,7 @@
 //          vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 );
 	  break;
    case vo_wm_Unknown:
-          vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 );
+//          vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 1 : 0 );
 	  XUnmapWindow( mDisplay,vo_window );
 	  break;
    case vo_wm_IceWM:
--- a/libvo/x11_common.h	Tue May 07 21:58:01 2002 +0000
+++ b/libvo/x11_common.h	Wed May 08 16:41:44 2002 +0000
@@ -25,14 +25,15 @@
 extern int vo_mouse_timer_const;
 extern int vo_mouse_autohide;
 
-int vo_init( void );
-int vo_hidecursor ( Display* , Window );
+extern int vo_init( void );
+extern void vo_uninit( void );
+extern int vo_hidecursor ( Display* , Window );
 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, int max );
-int vo_x11_check_events(Display *mydisplay);
-void vo_x11_fullscreen( void );
+extern void vo_x11_decoration( Display * vo_Display,Window w,int d );
+extern void vo_x11_classhint( Display * display,Window window,char *name );
+extern void vo_x11_sizehint( int x, int y, int width, int height, int max );
+extern int vo_x11_check_events(Display *mydisplay);
+extern void vo_x11_fullscreen( void );
 #endif
 
 extern Window     vo_window;
--- a/mplayer.c	Tue May 07 21:58:01 2002 +0000
+++ b/mplayer.c	Wed May 08 16:41:44 2002 +0000
@@ -354,6 +354,7 @@
 void exit_player(char* how){
 
   uninit_player(INITED_ALL);
+  vo_uninit();
 
   current_module="exit_player";