# HG changeset patch # User ib # Date 1369583327 0 # Node ID 2e0729818242e8243e0b35d8fa01b9d382ea1be2 # Parent 16e7d4a1ee5939bb500044787ff79b94b48b412f Relocate internal wsWindowList registration code. Register early. diff -r 16e7d4a1ee59 -r 2e0729818242 gui/wm/ws.c --- a/gui/wm/ws.c Sun May 26 12:41:09 2013 +0000 +++ b/gui/wm/ws.c Sun May 26 15:48:47 2013 +0000 @@ -788,6 +788,21 @@ { int depth; + { + int i; + + for (i = 0; i < wsWLCount; i++) + if (wsWindowList[i] == NULL) + break; + + if (i == wsWLCount) { + mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_TooManyOpenWindows); + mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); + } + + wsWindowList[i] = win; + } + win->Property = p; win->Decoration = ((p & wsShowFrame) != 0); @@ -909,21 +924,6 @@ wsImageCreate(win, win->Width, win->Height); /* End of creating -------------------------------------------------------------------------- */ - { - int i; - - for (i = 0; i < wsWLCount; i++) - if (wsWindowList[i] == NULL) - break; - - if (i == wsWLCount) { - mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_TooManyOpenWindows); - mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); - } - - wsWindowList[i] = win; - } - XFlush(wsDisplay); XSync(wsDisplay, False);