changeset 5986:d34622ebaf45

window resize bug fixed
author pontscho
date Sun, 05 May 2002 18:46:42 +0000
parents cb393303865d
children 08c552788216
files Gui/interface.c Gui/mplayer/play.c Gui/mplayer/play.h Gui/wm/ws.c
diffstat 4 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/interface.c	Sun May 05 18:16:27 2002 +0000
+++ b/Gui/interface.c	Sun May 05 18:46:42 2002 +0000
@@ -98,7 +98,11 @@
 	break;
    case guiSetShVideo:
 	 {
-	  mplResizeToMovieSize( vo_dwidth,vo_dheight );
+	  if ( !appMPlayer.subWindow.isFullScreen )
+	   {
+	    wsResizeWindow( &appMPlayer.subWindow,vo_dwidth,vo_dheight );
+            wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
+	   }
 	  guiIntfStruct.MovieWidth=vo_dwidth;
 	  guiIntfStruct.MovieHeight=vo_dwidth;
          }
--- a/Gui/mplayer/play.c	Sun May 05 18:16:27 2002 +0000
+++ b/Gui/mplayer/play.c	Sun May 05 18:46:42 2002 +0000
@@ -207,15 +207,6 @@
  btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen );
 }
 
-void mplResizeToMovieSize( unsigned int width,unsigned int height )
-{
- if ( !appMPlayer.subWindow.isFullScreen )
-  {
-   wsResizeWindow( &appMPlayer.subWindow,width,height );
-   wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
-  }
-}
-
 void mplSetFileName( char * fname )
 {
  if ( !fname ) return;
--- a/Gui/mplayer/play.h	Sun May 05 18:16:27 2002 +0000
+++ b/Gui/mplayer/play.h	Sun May 05 18:46:42 2002 +0000
@@ -15,7 +15,6 @@
 extern void mplState( void );
 extern void mplPrev( void );
 extern void mplNext( void );
-extern void mplResizeToMovieSize( unsigned int width,unsigned int height );
 
 extern void mplIncAudioBufDelay( void );
 extern void mplDecAudioBufDelay( void );
--- a/Gui/wm/ws.c	Sun May 05 18:16:27 2002 +0000
+++ b/Gui/wm/ws.c	Sun May 05 18:46:42 2002 +0000
@@ -361,6 +361,7 @@
  win->SizeHint.y=win->Y;
  win->SizeHint.width=win->Width;
  win->SizeHint.height=win->Height;
+
  if ( D & wsMinSize )
   {
    win->SizeHint.flags|=PMinSize;
@@ -373,6 +374,7 @@
    win->SizeHint.max_width=win->Width;
    win->SizeHint.max_height=win->Height;
   }
+
  win->SizeHint.height_inc=1;
  win->SizeHint.width_inc=1;
  win->SizeHint.base_width=win->Width;
@@ -770,9 +772,12 @@
  win->Width=sx;
  win->Height=sy;
 
- win->SizeHint.flags=PSize | PWinGravity;
+ 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;
+/*
  if ( win->Property & wsMinSize )
   {
    win->SizeHint.flags|=PMinSize;
@@ -785,9 +790,13 @@
    win->SizeHint.max_width=win->Width;
    win->SizeHint.max_height=win->Height;
   }
+*/
  win->SizeHint.win_gravity=StaticGravity;
+ win->SizeHint.base_width=sx; win->SizeHint.base_height=sy;
+ if ( !wsIsKDE ) XUnmapWindow( wsDisplay,win->WindowID );
  XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
  XResizeWindow( wsDisplay,win->WindowID,sx,sy );
+ XMapRaised( wsDisplay,win->WindowID );
  if ( win->ReSize ) win->ReSize( win->X,win->Y,win->Width,win->Height );
 }