diff Gui/wm/ws.c @ 8949:d07ab8e088a9

correct skin changing (fix one critical bug)
author pontscho
date Mon, 13 Jan 2003 23:38:49 +0000
parents e3bce0159317
children 0a665389cf2b
line wrap: on
line diff
--- a/Gui/wm/ws.c	Mon Jan 13 19:39:57 2003 +0000
+++ b/Gui/wm/ws.c	Mon Jan 13 23:38:49 2003 +0000
@@ -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;
 }