[Mplayer-cvslog] CVS: main/Gui/wm ws.c,1.63,1.64

Zoltan Ponekker pontscho at mplayerhq.hu
Tue Jan 14 00:38:52 CET 2003


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

Modified Files:
	ws.c 
Log Message:


correct skin changing
(fix one critical bug)


Index: ws.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- ws.c	12 Jan 2003 17:34:46 -0000	1.63
+++ ws.c	13 Jan 2003 23:38:49 -0000	1.64
@@ -68,8 +68,8 @@
 
 int                  wsTrue    = True;
 
-wsTWindow          * wsWindowList[5] = { NULL,NULL,NULL,NULL,NULL };
-int                  wsWLCount = 0;
+#define	wsWLCount 5
+wsTWindow          * wsWindowList[wsWLCount] = { NULL,NULL,NULL,NULL,NULL };
 
 unsigned long        wsKeyTable[512];
 
@@ -446,7 +446,14 @@
  wsCreateImage( win,win->Width,win->Height );
 // --- End of creating --------------------------------------------------------------------------
 
- wsWindowList[wsWLCount++]=win;
+ {
+  int i;
+  for ( i=0;i < wsWLCount;i++ )
+   if ( wsWindowList[i] == NULL ) break;
+  if ( i == wsWLCount )
+   { printf( "!!! tul sok nyitott ablak van.\n" ); exit( 1 ); }
+  wsWindowList[i]=win;
+ }
 
  XFlush( wsDisplay );
  XSync( wsDisplay,False );
@@ -469,9 +476,11 @@
     XFreeCursor( wsDisplay,win->wsCursor );
     win->wsCursor=None;
    }
+ XFreeGC( wsDisplay,win->wGC );
  XUnmapWindow( wsDisplay,win->WindowID );
  wsDestroyImage( win );
  XDestroyWindow( wsDisplay,win->WindowID );
+#if 0
  win->ReDraw=NULL;
  win->ReSize=NULL;
  win->Idle=NULL;
@@ -481,6 +490,7 @@
  win->Focused=0;
  win->Mapped=0;
  win->Rolled=0;
+#endif
 }
 
 // ----------------------------------------------------------------------------------------------
@@ -490,7 +500,7 @@
 inline int wsSearch( Window win )
 {
  int i;
- for ( i=0;i<wsWLCount;i++ ) if ( wsWindowList[i]->WindowID == win ) return i;
+ for ( i=0;i<wsWLCount;i++ ) if ( wsWindowList[i] && wsWindowList[i]->WindowID == win ) return i;
  return -1;
 }
 



More information about the MPlayer-cvslog mailing list