diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-13 23:38:49 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-13 23:38:49 +0000 |
commit | 5b16ccc998296b12092403bc6abad2c60abcbf65 (patch) | |
tree | 85a42b78ab8e0cd828287979b40c1fd02cd9243a /Gui/wm/ws.c | |
parent | d462b79a484d1477000aa0af2f30d1dcafe77f97 (diff) | |
download | mpv-5b16ccc998296b12092403bc6abad2c60abcbf65.tar.bz2 mpv-5b16ccc998296b12092403bc6abad2c60abcbf65.tar.xz |
correct skin changing
(fix one critical bug)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8950 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/wm/ws.c')
-rw-r--r-- | Gui/wm/ws.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Gui/wm/ws.c b/Gui/wm/ws.c index d5d4e4821b..979720e4dc 100644 --- a/Gui/wm/ws.c +++ b/Gui/wm/ws.c @@ -68,8 +68,8 @@ int wsOutMask = 0; 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 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns 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 @@ void wsDestroyWindow( wsTWindow * win ) 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 @@ void wsDestroyWindow( wsTWindow * win ) win->Focused=0; win->Mapped=0; win->Rolled=0; +#endif } // ---------------------------------------------------------------------------------------------- @@ -490,7 +500,7 @@ void wsDestroyWindow( wsTWindow * win ) 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; } |