changeset 2851:b64fa5d25142

add roleld mouse support and some small bugfix. neked jol a testedbe.
author pontscho
date Mon, 12 Nov 2001 12:26:09 +0000
parents 2f1e40539fe2
children 5f92a92a4c47
files Gui/app.h Gui/mplayer/mw.h Gui/mplayer/sw.h Gui/wm/ws.c Gui/wm/ws.h
diffstat 5 files changed, 218 insertions(+), 207 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/app.h	Mon Nov 12 02:01:24 2001 +0000
+++ b/Gui/app.h	Mon Nov 12 12:26:09 2001 +0000
@@ -50,7 +50,7 @@
 {
  wItem           main;
  wsTWindow       mainWindow;
- int		 mainDecoration;
+ int             mainDecoration;
 
  wItem           sub;
  wsTWindow       subWindow;
--- a/Gui/mplayer/mw.h	Mon Nov 12 02:01:24 2001 +0000
+++ b/Gui/mplayer/mw.h	Mon Nov 12 12:26:09 2001 +0000
@@ -10,7 +10,6 @@
 int             mainVisible = 1;
 
 int             boxMoved = 0;
-int             msButton = 0;
 int             sx = 0,sy = 0;
 int             i,pot = 0;
 
@@ -94,24 +93,24 @@
        case 's': if ( mplShMem->Playing == 0 ) strcat( trbuf,"s" ); break;
        case 'l': if ( mplShMem->Playing == 1 ) strcat( trbuf,"p" ); break;
        case 'e': if ( mplShMem->Playing == 2 ) strcat( trbuf,"e" ); break;
-       case 'a': 
+       case 'a':
             switch ( mplShMem->AudioType )
-	     {
-	      case 0: strcat( trbuf,"n" ); break;
-	      case 1: strcat( trbuf,"m" ); break;
-	      case 2: strcat( trbuf,"t" ); break;
-	     }
-	    break;
-       case 'T': 
-    	   switch ( mplShMem->StreamType )
-	    {
-	     case STREAMTYPE_FILE:   strcat( trbuf,"f" ); break;
-	     case STREAMTYPE_VCD:    strcat( trbuf,"v" ); break;
-	     case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
-	     case STREAMTYPE_DVD:    strcat( trbuf,"d" ); break;
-	     default:                strcat( trbuf," " ); break;
-	    }
-	   break;
+             {
+              case 0: strcat( trbuf,"n" ); break;
+              case 1: strcat( trbuf,"m" ); break;
+              case 2: strcat( trbuf,"t" ); break;
+             }
+            break;
+       case 'T':
+           switch ( mplShMem->StreamType )
+            {
+             case STREAMTYPE_FILE:   strcat( trbuf,"f" ); break;
+             case STREAMTYPE_VCD:    strcat( trbuf,"v" ); break;
+             case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
+             case STREAMTYPE_DVD:    strcat( trbuf,"d" ); break;
+             default:                strcat( trbuf," " ); break;
+            }
+           break;
        case '$': strcat( trbuf,"$" ); break;
        default: continue;
       }
@@ -162,14 +161,14 @@
    case 0:
         btnModify( evPlaySwitchToPause,btnReleased );
         btnModify( evPauseSwitchToPlay,btnDisabled );
-	break;
+        break;
    case 1:
         if ( mplShMem->Filename[0] != 0 )
-	 {
+         {
           btnModify( evPlaySwitchToPause,btnDisabled );
-	  btnModify( evPauseSwitchToPlay,btnReleased );
-	 }
-  }	 
+          btnModify( evPauseSwitchToPlay,btnReleased );
+         }
+  }
 
 // --- erosen ideiglenes.
  strcpy( gtkShMem->fs.filename,mplShMem->Filename );
@@ -188,11 +187,11 @@
             break;
        case itPotmeter:
             PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
-	    break;
+            break;
        case itHPotmeter:
             PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
             PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed );
-	    break;
+            break;
        case itSLabel:
             image=fntRender( item->fontid,0,item->width,"%s",item->label );
             goto drawrenderedtext;
@@ -230,14 +229,14 @@
    case evExit:
 //        IZE("evExit");
         wsDoExit();  // sets wsTrue=False;
-	exit_player( "Exit" );
+        exit_player( "Exit" );
         break;
    case evIconify:
-	switch ( (int)param )
-	 {
-	  case 0: wsIconify( appMPlayer.mainWindow ); break;
-	  case 1: wsIconify( appMPlayer.subWindow ); break;
-	 }
+        switch ( (int)param )
+         {
+          case 0: wsIconify( appMPlayer.mainWindow ); break;
+          case 1: wsIconify( appMPlayer.subWindow ); break;
+         }
         break;
    case evFullScreen:
         IZE("evFullS");
@@ -340,32 +339,32 @@
    case evIncVolume:  vo_x11_putkey( wsGrayMul ); break;
    case evDecVolume:  vo_x11_putkey( wsGrayDiv ); break;
    case evMute:       mplShMem->Mute=1; break;
-   case evSetVolume:  
+   case evSetVolume:
    case evSetBalance: mplShMem->VolumeChanged=1; break;
 
 
    case evNormalSize:
-        if ( mplShMem->Playing ) 
-	 {
-	  appMPlayer.subWindow.isFullScreen=True;
-	  appMPlayer.subWindow.OldX=( wsMaxX - moviewidth ) / 2;
-	  appMPlayer.subWindow.OldY=( wsMaxY - movieheight ) / 2;
-	  appMPlayer.subWindow.OldWidth=moviewidth; appMPlayer.subWindow.OldHeight=movieheight;
-	  wsFullScreen( &appMPlayer.subWindow );
-	  mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
-	 } 
-	break;
-   case evDoubleSize: 
-        if ( mplShMem->Playing ) 
-	 {
-	  appMPlayer.subWindow.isFullScreen=True; 
-	  appMPlayer.subWindow.OldX=( wsMaxX - moviewidth * 2 ) / 2;
-	  appMPlayer.subWindow.OldY=( wsMaxY - movieheight * 2 ) / 2;
-	  appMPlayer.subWindow.OldWidth=moviewidth * 2; appMPlayer.subWindow.OldHeight=movieheight * 2;
-	  wsFullScreen( &appMPlayer.subWindow );
-	  mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
-	 }
-	break;
+        if ( mplShMem->Playing )
+         {
+          appMPlayer.subWindow.isFullScreen=True;
+          appMPlayer.subWindow.OldX=( wsMaxX - moviewidth ) / 2;
+          appMPlayer.subWindow.OldY=( wsMaxY - movieheight ) / 2;
+          appMPlayer.subWindow.OldWidth=moviewidth; appMPlayer.subWindow.OldHeight=movieheight;
+          wsFullScreen( &appMPlayer.subWindow );
+          mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
+         }
+        break;
+   case evDoubleSize:
+        if ( mplShMem->Playing )
+         {
+          appMPlayer.subWindow.isFullScreen=True;
+          appMPlayer.subWindow.OldX=( wsMaxX - moviewidth * 2 ) / 2;
+          appMPlayer.subWindow.OldY=( wsMaxY - movieheight * 2 ) / 2;
+          appMPlayer.subWindow.OldWidth=moviewidth * 2; appMPlayer.subWindow.OldHeight=movieheight * 2;
+          wsFullScreen( &appMPlayer.subWindow );
+          mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
+         }
+        break;
 
 // --- timer events
    case evHideMouseCursor:
@@ -374,10 +373,10 @@
    case evRedraw:
         mplMainRender=1;
         wsPostRedisplay( &appMPlayer.mainWindow );
-//        if ( !mplShMem->Playing ) 
-//	wsPostRedisplay( &appMPlayer.subWindow );
+//        if ( !mplShMem->Playing )
+//      wsPostRedisplay( &appMPlayer.subWindow );
         XFlush( wsDisplay );
-	mplRedrawTimer=mplRedrawTimerConst;
+        mplRedrawTimer=mplRedrawTimerConst;
         break;
    case evGeneralTimer:
         if ( mplMainAutoPlay )
@@ -397,96 +396,115 @@
   }
 }
 
+#define itPLMButton (itNULL - 1)
+#define itPRMButton (itNULL - 2)
+
 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
 {
  static int     itemtype = 0;
- static int     SelectedButton = -1;
+        int     i;
         wItem * item = NULL;
         float   value = 0.0f;
+
+ static int     SelectedItem = -1;
+        int     currentselected = -1;
+
  wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
+
+ for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
+  if ( ( appMPlayer.Items[i].pressed != btnDisabled )&&
+       ( wgIsRect( X,Y,appMPlayer.Items[i].x,appMPlayer.Items[i].y,appMPlayer.Items[i].x+appMPlayer.Items[i].width,appMPlayer.Items[i].y+appMPlayer.Items[i].height ) ) )
+   { currentselected=i; break; }
+
  switch ( Button )
   {
    case wsPRMouseButton:
           mplShowMenu( RX,RY );
-          msButton=wsPRMouseButton;
+          itemtype=itPRMButton;
           break;
    case wsRRMouseButton:
           mplHideMenu( RX,RY );
-          msButton=0;
           break;
+
    case wsPLMouseButton:
-          sx=X; sy=Y;
-          boxMoved=1;
-          msButton=wsPLMouseButton;
-          for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
+          sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton; // if move the main window
+          SelectedItem=currentselected;
+          if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window
+          boxMoved=0; mplMainRender=1; // No, not move the window, i'm pressed one button
+          item=&appMPlayer.Items[SelectedItem];
+          itemtype=item->type;
+          item->pressed=btnPressed;
+          item->used=1;
+          switch( item->type )
            {
-            item=&appMPlayer.Items[i];
-            if ( item->pressed != btnDisabled )
-             {
-              switch( item->type )
-               {
-                case itButton:
-                     if ( wgIsRect( X,Y,
-                          item->x,item->y,
-                          item->x+item->width,item->y+item->height ) )
-                      {
-                       item->pressed=btnPressed;
-                       mplMainRender=1;
-                       SelectedButton=i;
-                       msButton=0;
-                       boxMoved=0;
-                      }
-                     if ( ( SelectedButton > -1 ) &&
-                        ( ( ( appMPlayer.Items[SelectedButton].msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
-                          ( ( appMPlayer.Items[SelectedButton].msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
-                      {
-                       appMPlayer.Items[SelectedButton].pressed=btnDisabled;
-                       SelectedButton=i;
-                       appMPlayer.Items[SelectedButton].pressed=btnPressed;
-                      }
-                     itemtype=itButton;
-                     break;
-                case itPotmeter:
-                     if ( wgIsRect( X,Y,
-                          item->x,item->y,
-                          item->x+item->width,item->y+item->height ) )
-                      {
-                       item->pressed=btnPressed;
-		       item->used=1;
-                       mplMainRender=1;
-                       SelectedButton=i;
-                       boxMoved=0;
-                       msButton=itPotmeter;
-                       itemtype=itPotmeter;
-                      }
-                      break;
-                case itHPotmeter:
-                     if ( wgIsRect( X,Y,
-                          item->x,item->y,
-                          item->x+item->width,item->y+item->height ) )
-                      {
-                       item->pressed=btnPressed;
-		       item->used=1;
-                       mplMainRender=1;
-                       SelectedButton=i;
-                       boxMoved=0;
-                       msButton=itHPotmeter;
-                       itemtype=itHPotmeter;
-                      }
-                     break;
-               }
-             }
+            case itButton:
+                 if ( ( SelectedItem > -1 ) &&
+                    ( ( ( appMPlayer.Items[SelectedItem].msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
+                      ( ( appMPlayer.Items[SelectedItem].msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
+                  { appMPlayer.Items[SelectedItem].pressed=btnDisabled; }
+                 break;
            }
           break;
+   case wsRLMouseButton:
+          boxMoved=0;
+          item=&appMPlayer.Items[SelectedItem];
+          item->pressed=btnReleased;
+          SelectedItem=-1;
+          if ( currentselected == - 1 ) { itemtype=0; break; }
+          value=0;
+          switch( itemtype )
+           {
+            case itPotmeter:
+            case itHPotmeter:
+                 item->used=0;
+                 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
+                 switch ( item->msg )
+                  {
+                   case evSetVolume:
+                        mplShMem->VolumeChanged=1;
+                        mplShMem->Volume=item->value;
+                        break;
+                  }
+                 value=item->value;
+                 break;
+           }
+          mplMsgHandle( item->msg,value );
+          mplMainRender=1;
+          itemtype=0;
+          break;
+
+// --- rolled mouse ... de szar :)))
+   case wsP5MouseButton: value=-2.5f; goto rollerhandled;
+   case wsP4MouseButton: value= 2.5f;
+rollerhandled:
+          item=&appMPlayer.Items[currentselected];
+          if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
+           {
+            item->used=0;
+            item->value+=value;
+            btnModify( item->msg,item->value );
+            switch ( item->msg )
+             {
+              case evSetVolume:
+                   mplShMem->VolumeChanged=1;
+                   mplShMem->Volume=item->value;
+                   break;
+             }
+            mplMsgHandle( item->msg,item->value );
+            mplMainRender=1;
+           }
+          break;
+
+// --- moving
    case wsMoveMouse:
-          item=&appMPlayer.Items[SelectedButton];
-          switch ( msButton )
+          item=&appMPlayer.Items[SelectedItem];
+          switch ( itemtype )
            {
-            case wsPLMouseButton:
+            case itPLMButton:
                  wsMoveWindow( &appMPlayer.mainWindow,RX - abs( sx ),RY - abs( sy ) );
                  mplMainRender=0;
                  break;
-            case wsPRMouseButton:
+            case itPRMButton:
                  mplMenuMouseHandle( X,Y,RX,RY );
                  break;
             case itPotmeter:
@@ -495,49 +513,20 @@
             case itHPotmeter:
                  item->value=(float)( X - item->x ) / item->width * 100.0f;
 potihandled:
-		 if ( item->value > 100.0f ) item->value=100.0f;
-		 if ( item->value < 0.0f ) item->value=0.0f;
-                 if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) 
-		  {
-		   mplShMem->VolumeChanged=1;
-		   mplShMem->Volume=item->value;
-		  }
-		 mplMsgHandle( item->msg,item->value );
+                 if ( item->value > 100.0f ) item->value=100.0f;
+                 if ( item->value < 0.0f ) item->value=0.0f;
+                 switch ( item->msg )
+                  {
+                   case evSetVolume:
+                        mplShMem->VolumeChanged=1;
+                        mplShMem->Volume=item->value;
+                        break;
+                  }
+                 mplMsgHandle( item->msg,item->value );
                  mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
                  break;
            }
           break;
-   case wsRLMouseButton:
-          msButton=0;
-          boxMoved=0;
-          item=&appMPlayer.Items[SelectedButton];
-          item->pressed=btnReleased;
-          switch( itemtype )
-           {
-            case itButton:
-                 if ( wgIsRect( X,Y,
-                        item->x,item->y,
-                        item->x+item->width,item->y+item->height ) ) value=0;
-                  break;
-            case itPotmeter:
-            case itHPotmeter:
-		 item->used=0;
-                 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
-                 if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) ) 
-		  {
-		   mplShMem->VolumeChanged=1;
-		   mplShMem->Volume=item->value;
-		  }
-		 value=item->value;
-                 break;
-           }
-          if ( SelectedButton != -1 ) mplMsgHandle( item->msg,value );
-          SelectedButton=-1;
-          mplMainRender=1;
-          itemtype=0;
-          break;
-   case wsPMMouseButton: break;
-   case wsRMMouseButton: break;
   }
  if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow );
 }
@@ -556,14 +545,6 @@
 
    case wsEscape:    msg=evExit; break;
 
-//   case wsUp:        msg=evForward1min; break;
-//   case wsDown:      msg=evBackward1min; break;
-//   case wsRight:     msg=evForward10sec; break;
-//   case wsLeft:      msg=evBackward10sec; break;
-
-//   case wsGrayMul:   msg=evIncVolume; break;
-//   case wsGrayDiv:   msg=evDecVolume; break;
-
    case wsEnter:     msg=evPlay; break;
    case wsSpace:     msg=evPause; break;
    case wsa:
@@ -582,7 +563,7 @@
    case wsS:         msg=evStop; break;
    case wsp:
    case wsP:         msg=evPlayList; break;
-   default:	     vo_x11_putkey( Key ); return;
+   default:          vo_x11_putkey( Key ); return;
   }
  if ( ( msg != evNone )&&( Type == wsKeyPressed ) )
   {
--- a/Gui/mplayer/sw.h	Mon Nov 12 02:01:24 2001 +0000
+++ b/Gui/mplayer/sw.h	Mon Nov 12 12:26:09 2001 +0000
@@ -7,13 +7,13 @@
 void mplSubDraw( wsParamDisplay )
 {
  if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++;
- 
+
  if ( !appMPlayer.subWindow.Mapped ||
       appMPlayer.subWindow.Visible == wsWindowNotVisible ) return;
 
  if ( mplShMem->Playing )
-  { 
-   vo_expose=1; 
+  {
+   vo_expose=1;
    mplSubRender=0;
   }
 
@@ -22,12 +22,13 @@
    if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow );
 //   XFlush( wsDisplay );
   }
- appMPlayer.subWindow.State=0; 
+ appMPlayer.subWindow.State=0;
 }
 
 void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
 {
  static int mplSubMoved = 0;
+ static int msButton = 0;
 
  mplMouseTimer=mplMouseTimerConst;
  wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
@@ -42,7 +43,7 @@
           mplHideMenu( RX,RY );
           msButton=0;
           break;
-// ---	  
+// ---
    case wsPLMouseButton:
           sx=X; sy=Y;
           msButton=wsPLMouseButton;
@@ -64,18 +65,18 @@
    case wsRLMouseButton:
 //          if ( ( !mplSubMoved )&&( ( SubVisible++%2 ) ) ) wsMoveTopWindow( &appMPlayer.mainWindow );
           if ( !mplSubMoved )
-	   {
-	    if( SubVisible++%2 )
-	     {
-	      wsMoveTopWindow( &appMPlayer.mainWindow );
-	      fprintf( stderr,"[sw] MAIN TOP\n" );
-	     } 
-	     else 
-	      {
-	       wsMoveTopWindow( &appMPlayer.subWindow );
-	       fprintf( stderr,"[sw] SUB TOP\n" );
-	      }
-	   }
+           {
+            if( SubVisible++%2 )
+             {
+              wsMoveTopWindow( &appMPlayer.mainWindow );
+              fprintf( stderr,"[sw] MAIN TOP\n" );
+             }
+             else
+              {
+               wsMoveTopWindow( &appMPlayer.subWindow );
+               fprintf( stderr,"[sw] SUB TOP\n" );
+              }
+           }
           msButton=0;
           mplSubMoved=0;
           break;
--- a/Gui/wm/ws.c	Mon Nov 12 02:01:24 2001 +0000
+++ b/Gui/wm/ws.c	Mon Nov 12 12:26:09 2001 +0000
@@ -107,6 +107,7 @@
 
 void wsWindowDecoration( wsTWindow * win,long d )
 {
+//XUnmapWindow( wsDisplay,win->WindowID );
  wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 );
  if ( wsMotifHints != None )
   {
@@ -117,6 +118,17 @@
    XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
                     PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
   }
+//XMapWindow( wsDisplay,win->WindowID );
+// if ( d )
+//  {
+//   win->SizeHint.win_gravity=ForgetGravity;
+//  }
+//   else
+//    {
+//     win->SizeHint.win_gravity=StaticGravity;
+//    }
+// win->SizeHint.flags=PWinGravity;
+// XSetWMSizeHints( wsDisplay,win->WindowID,&win->SizeHint,win->AtomWMSizeHint );
 }
 
 // ----------------------------------------------------------------------------------------------
@@ -350,6 +362,8 @@
  win->AtomDeleteWindow=XInternAtom( wsDisplay,"WM_DELETE_WINDOW",False );
  win->AtomTakeFocus=XInternAtom( wsDisplay,"WM_TAKE_FOCUS",False );
  win->AtomRolle=XInternAtom( wsDisplay,"WM_WINDOW_ROLE",False );
+ win->AtomWMSizeHint=XInternAtom( wsDisplay,"WM_SIZE_HINT",False );
+ win->AtomWMNormalHint=XInternAtom( wsDisplay,"WM_NORMAL_HINT",False );
  win->AtomProtocols=XInternAtom( wsDisplay,"WM_PROTOCOLS",False );
  {
   char buf[32]; int i;
@@ -406,7 +420,7 @@
  wsClassHint.res_class="MPlayer";
  XSetClassHint( wsDisplay,win->WindowID,&wsClassHint );
 
- win->SizeHint.flags=PPosition | PSize | PResizeInc; // | PBaseSize
+ win->SizeHint.flags=PPosition | PSize | PResizeInc | PWinGravity; // | PBaseSize
  win->SizeHint.x=win->X;
  win->SizeHint.y=win->Y;
  win->SizeHint.width=win->Width;
@@ -427,6 +441,7 @@
  win->SizeHint.width_inc=1;
 // win->SizeHint.base_width=win->Width;
 // win->SizeHint.base_height=win->Height;
+ win->SizeHint.win_gravity=StaticGravity;
  XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
 
  win->WMHints.flags=InputHint | StateHint;
@@ -574,14 +589,14 @@
    case UnmapNotify: i=wsWindowUnmapped; wsWindowList[l]->Mapped=wsNone;     goto expose;
    case FocusIn:
         if ( wsWindowList[l]->Focused == wsFocused ) break;
-        i=wsWindowFocusIn; 
-	wsWindowList[l]->Focused=wsFocused; 
-	goto expose;
+        i=wsWindowFocusIn;
+        wsWindowList[l]->Focused=wsFocused;
+        goto expose;
    case FocusOut:
         if ( wsWindowList[l]->Focused == wsNone ) break;
-        i=wsWindowFocusOut; 
-	wsWindowList[l]->Focused=wsNone;   
-	goto expose;
+        i=wsWindowFocusOut;
+        wsWindowList[l]->Focused=wsNone;
+        goto expose;
    case VisibilityNotify:
         switch( Event->xvisibility.state )
          {
@@ -648,11 +663,17 @@
           wsWindowList[l]->MouseHandler( i,Event->xbutton.x,Event->xbutton.y,Event->xmotion.x_root,Event->xmotion.y_root );
         break;
 
+   case GravityNotify:
+//        #ifdef DEBUG
+         fprintf( stderr,"[ws] window ( 0x%x ) gravity: %d,%d\n",wsWindowList[l]->WindowID,Event->xgravity.x,Event->xgravity.y );
+//      #endif
+        break;
+
    case PropertyNotify:
-//	break;
-//	#ifdef DEBUG
+//      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
+//      #endif
         if ( Event->xproperty.atom == wsWindowList[l]->AtomRemote )
          {
           Atom            type;
@@ -672,9 +693,9 @@
            {
             args[strlen( args ) - 1]=0;
             wsWindowList[l]->RemoteHandler( args );
-	    #ifdef DEBUG
- 	     fprintf( stderr,"[ws]   args: '%s'\n",args );
-	    #endif
+            #ifdef DEBUG
+             fprintf( stderr,"[ws]   args: '%s'\n",args );
+            #endif
             args[strlen( args ) - 1]=1;
             XFree( args );
            }
@@ -850,9 +871,10 @@
    default: win->Y=y; break;
   }
 
- win->SizeHint.flags=PPosition;
+ win->SizeHint.flags=PPosition | PWinGravity;
  win->SizeHint.x=win->X;
  win->SizeHint.y=win->Y;
+ win->SizeHint.win_gravity=StaticGravity;
  XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
 
  XMoveWindow( wsDisplay,win->WindowID,win->X,win->Y );
@@ -867,7 +889,7 @@
  win->Width=sx;
  win->Height=sy;
 
- win->SizeHint.flags=PSize;
+ win->SizeHint.flags=PSize | PWinGravity;
  win->SizeHint.width=win->Width;
  win->SizeHint.height=win->Height;
  if ( win->Property & wsMinSize )
@@ -882,6 +904,7 @@
    win->SizeHint.max_width=win->Width;
    win->SizeHint.max_height=win->Height;
   }
+ win->SizeHint.win_gravity=StaticGravity;
  XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
  XResizeWindow( wsDisplay,win->WindowID,sx,sy );
  if ( win->ReSize ) win->ReSize( win->X,win->Y,win->Width,win->Height );
@@ -897,9 +920,9 @@
 //    Move top the window.
 // ----------------------------------------------------------------------------------------------
 void wsMoveTopWindow( wsTWindow * win )
-{ 
-// XUnmapWindow( wsDisplay,win->WindowID ); XMapWindow( wsDisplay,win->WindowID ); 
- XRaiseWindow( wsDisplay,win->WindowID ); 
+{
+// XUnmapWindow( wsDisplay,win->WindowID ); XMapWindow( wsDisplay,win->WindowID );
+ XRaiseWindow( wsDisplay,win->WindowID );
 }
 
 // ----------------------------------------------------------------------------------------------
--- a/Gui/wm/ws.h	Mon Nov 12 02:01:24 2001 +0000
+++ b/Gui/wm/ws.h	Mon Nov 12 12:26:09 2001 +0000
@@ -25,9 +25,13 @@
 #define  wsPLMouseButton 1
 #define  wsPMMouseButton 2
 #define  wsPRMouseButton 3
+#define  wsP4MouseButton 4
+#define  wsP5MouseButton 5
 #define  wsRLMouseButton 1 + 128
 #define  wsRMMouseButton 2 + 128
 #define  wsRRMouseButton 3 + 128
+#define  wsR4MouseButton 4 + 128
+#define  wsR5MouseButton 5 + 128
 #define  wsEnterWindow   253
 #define  wsLeaveWindow   254
 #define  wsMoveMouse     255
@@ -131,6 +135,8 @@
  Atom                 AtomsProtocols[3];
  Atom                 AtomLeaderClient;
  Atom                 AtomRemote;
+ Atom		      AtomWMSizeHint;
+ Atom		      AtomWMNormalHint;
 
  XShmSegmentInfo      Shminfo;
  unsigned char      * ImageData;