changeset 5910:20c335d98ab3

fix fullscreen bug es ilyen libvo not initialized bug with gui igy
author pontscho
date Mon, 29 Apr 2002 22:00:50 +0000
parents adc04b7ed226
children b499e48015cf
files Gui/mplayer/play.c Gui/wm/ws.c libvo/x11_common.c mplayer.c
diffstat 4 files changed, 53 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/play.c	Mon Apr 29 21:42:36 2002 +0000
+++ b/Gui/mplayer/play.c	Mon Apr 29 22:00:50 2002 +0000
@@ -31,6 +31,7 @@
 {
  static int sx,sy;
 
+#if 0
 // if ( !guiIntfStruct.Playing )
   {
    wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
@@ -52,7 +53,10 @@
    vo_fs=appMPlayer.subWindow.isFullScreen;     
    wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
   }// else { vo_x11_fullscreen(); appMPlayer.subWindow.isFullScreen=vo_fs; }
-  
+#else
+  wsFullScreen( &appMPlayer.subWindow );
+#endif
+
  fullscreen=appMPlayer.subWindow.isFullScreen;
  if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
   else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
--- a/Gui/wm/ws.c	Mon Apr 29 21:42:36 2002 +0000
+++ b/Gui/wm/ws.c	Mon Apr 29 22:00:50 2002 +0000
@@ -50,6 +50,7 @@
 Window               wsRootWin;
 XEvent               wsEvent;
 int                  wsWindowDepth;
+int		     wsWMType = 1;
 GC                   wsHGC;
 MotifWmHints         wsMotifWmHints;
 Atom                 wsTextProperlyAtom = None;
@@ -337,6 +338,7 @@
  win->AtomWMSizeHint=XInternAtom( wsDisplay,"WM_SIZE_HINT",False );
  win->AtomWMNormalHint=XInternAtom( wsDisplay,"WM_NORMAL_HINT",False );
  win->AtomProtocols=XInternAtom( wsDisplay,"WM_PROTOCOLS",False );
+#if 0
  {
   char buf[32]; int i;
   sprintf( buf,"_%s_REMOTE",label );
@@ -347,6 +349,7 @@
   fprintf( stderr,"[ws] atomname: %s\n",buf );
   win->AtomRemote=XInternAtom( wsDisplay,buf,False );
  }
+#endif
  win->AtomsProtocols[0]=win->AtomDeleteWindow;
  win->AtomsProtocols[1]=win->AtomTakeFocus;
  win->AtomsProtocols[2]=win->AtomRolle;
@@ -442,10 +445,12 @@
  wsTextProperty.nitems=strlen( label );
  XSetWMIconName( wsDisplay,win->WindowID,&wsTextProperty );
 
+#if 0
  XChangeProperty( wsDisplay,win->WindowID,
                   win->AtomRemote,XA_STRING,
                   8,PropModeReplace,
                   "REALIZED",8 );
+#endif
 
 //  win->Font=XLoadQueryFont( wsDisplay,"-adobe-helvetica-bold-r-normal--14-140-75-75-p-77-iso8859-1" );
 //  -adobe-times-medium-r-normal--14-140-75-75-p-77-iso8859-1" );
@@ -647,10 +652,20 @@
 //        break;
 
    case PropertyNotify:
-//      break;
-//      #ifdef DEBUG
-//         fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",wsWindowList[l]->WindowID,XGetAtomName( wsDisplay,Event->xproperty.atom ),Event->xproperty.atom );
-//      #endif
+	{
+	 char * name = XGetAtomName( wsDisplay,Event->xproperty.atom );
+	 
+         if ( !name ) break;
+	 if ( !strncmp( name,"_ICEWM_TRAY",11 ) ||
+	      !strncmp( name,"_KDE_",5 ) ||
+	      !strncmp( name,"KWM_WIN_DESKTOP",15 ) ) wsWMType=0;
+							  
+//         fprintf(stderr,"[ws] PropertyNotify %s ( 0x%x )\n",name,Event->xproperty.atom );
+							  
+	 XFree( name );
+	 break;
+	}
+#if 0
         if ( Event->xproperty.atom == wsWindowList[l]->AtomRemote )
          {
           Atom            type;
@@ -677,6 +692,7 @@
             XFree( args );
            }
          }
+#endif
         break;
 
   }
@@ -741,8 +757,7 @@
 void wsFullScreen( wsTWindow * win )
 {
  int decoration = 0;
- XUnmapWindow( wsDisplay,win->WindowID );
- win->SizeHint.flags=0;
+ if ( wsWMType ) XUnmapWindow( wsDisplay,win->WindowID );
  if ( win->isFullScreen )
   {
    win->X=win->OldX;
@@ -763,11 +778,11 @@
     wsScreenSaverOff( wsDisplay );
    }
 
- win->SizeHint.flags|=PPosition | PSize;
- win->SizeHint.x=win->X;
- win->SizeHint.y=win->Y;
- win->SizeHint.width=win->Width;
- win->SizeHint.height=win->Height;
+ win->SizeHint.flags=PPosition | PSize | PWinGravity | PBaseSize;
+ win->SizeHint.x=win->X;              win->SizeHint.y=win->Y;
+ win->SizeHint.width=win->Width;      win->SizeHint.height=win->Height;
+ win->SizeHint.base_width=win->Width; win->SizeHint.base_height=win->Height;
+ win->SizeHint.win_gravity=StaticGravity;
  if ( win->Property & wsMaxSize )
   {
    win->SizeHint.flags|=PMaxSize;
@@ -784,8 +799,8 @@
 
  XMoveResizeWindow( wsDisplay,win->WindowID,win->X,win->Y,win->Width,win->Height );
  wsWindowDecoration( win,decoration );
+ XMapRaised( wsDisplay,win->WindowID );
  XRaiseWindow( wsDisplay,win->WindowID );
- XMapWindow( wsDisplay,win->WindowID );
 }
 
 // ----------------------------------------------------------------------------------------------
--- a/libvo/x11_common.c	Mon Apr 29 21:42:36 2002 +0000
+++ b/libvo/x11_common.c	Mon Apr 29 22:00:50 2002 +0000
@@ -542,13 +542,18 @@
            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;
+    	   {
+	    char * name = XGetAtomName( mydisplay,Event.xproperty.atom );
+	    if ( !name ) break;
+	    if ( !strncmp( name,"_ICEWM_TRAY",11 ) ||
+		 !strncmp( name,"_KDE_",5 ) ||
+	         !strncmp( name,"KWM_WIN_DESKTOP",15 ) ) vo_wm_type=0;
 		
  	     fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",
-	      vo_window,XGetAtomName( mydisplay,Event.xproperty.atom ),Event.xproperty.atom );
-
+	      vo_window,name,Event.xproperty.atom );
+	      
+	    XFree( name );
+	   }
 	   break;
      }
   }
@@ -589,7 +594,7 @@
  vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
  XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
  XMapRaised( mDisplay,vo_window );
- 
+
  XRaiseWindow( mDisplay,vo_window );
  XFlush( mDisplay );
 }
--- a/mplayer.c	Mon Apr 29 21:42:36 2002 +0000
+++ b/mplayer.c	Mon Apr 29 22:00:50 2002 +0000
@@ -2945,16 +2945,6 @@
      eof = eof == PT_PREV_SRC ? -1 : 1;
 }
 
-#ifdef HAVE_NEW_GUI
- if( use_gui && !playtree_iter ) 
-  {
-#ifdef USE_DVDREAD
-   if ( !guiIntfStruct.DVDChanged ) 
-#endif
-   mplStop();
-  }	
-#endif
-
 if(eof == 0) eof = 1;
 
 while(playtree_iter != NULL) {
@@ -2968,6 +2958,16 @@
     break;
 } 
 
+#ifdef HAVE_NEW_GUI
+ if( use_gui && !playtree_iter ) 
+  {
+#ifdef USE_DVDREAD
+   if ( !guiIntfStruct.DVDChanged ) 
+#endif
+   mplStop();
+  }	
+#endif
+
 if(use_gui || playtree_iter != NULL
 #if defined( HAVE_NEW_GUI ) && defined( USE_DVDREAD )
  || ( guiIntfStruct.DVDChanged && use_gui )