[Mplayer-cvslog] CVS: main/Gui/wm ws.c,1.23,1.24 ws.h,1.7,1.8

Zoltan Ponekker pontscho at mplayer.dev.hu
Mon Nov 12 13:26:12 CET 2001


Update of /cvsroot/mplayer/main/Gui/wm
In directory mplayer:/var/tmp.root/cvs-serv19930/Gui/wm

Modified Files:
	ws.c ws.h 
Log Message:
add roleld mouse support and some small bugfix. neked jol a testedbe.

Index: ws.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ws.c	9 Nov 2001 13:05:55 -0000	1.23
+++ ws.c	12 Nov 2001 12:26:09 -0000	1.24
@@ -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 );
 }
 
 // ----------------------------------------------------------------------------------------------

Index: ws.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ws.h	4 Oct 2001 20:33:29 -0000	1.7
+++ ws.h	12 Nov 2001 12:26:09 -0000	1.8
@@ -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;




More information about the MPlayer-cvslog mailing list