Prevent winRaiseWindow from calling ConfigureWindow if the message was sent

from within winDestroyWindowsWindow
DestroyWindow send a WM_WINDOWPOSCHANGED to another window causing a
    restacking of all windows, even of the window which is just about to
    destroyed and whose structures may not be intact anymore.
This commit is contained in:
Alexander Gottwald 2005-03-07 22:26:59 +00:00
parent 978f3b496b
commit cb0aa2b4d8
3 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,14 @@
2005-03-07 Alexander Gottwald <ago at freedesktop dot org>
* winmultiwindowwndproc.c:
* winmultiwindowwindow.c:
Prevent winRaiseWindow from calling ConfigureWindow if the message
was sent from within winDestroyWindowsWindow
DestroyWindow send a WM_WINDOWPOSCHANGED to another window causing
a restacking of all windows, even of the window which is just about
to destroyed and whose structures may not be intact anymore.
2005-02-24 Alexander Gottwald <ago at freedesktop dot org>
* winmultiwindowwndproc.c:

View File

@ -611,6 +611,7 @@ winCreateWindowsWindow (WindowPtr pWin)
}
Bool winInDestroyWindowsWindow = FALSE;
/*
* winDestroyWindowsWindow - Destroy a Windows window associated
* with an X window
@ -625,6 +626,7 @@ winDestroyWindowsWindow (WindowPtr pWin)
HMODULE hInstance;
int iReturn;
char pszClass[512];
BOOL oldstate = winInDestroyWindowsWindow;
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winDestroyWindowsWindow\n");
@ -634,6 +636,8 @@ winDestroyWindowsWindow (WindowPtr pWin)
if (pWinPriv->hWnd == NULL)
return;
winInDestroyWindowsWindow = TRUE;
/* Store the info we need to destroy after this window is gone */
hInstance = (HINSTANCE) GetClassLong (pWinPriv->hWnd, GCL_HMODULE);
hiconClass = (HICON) GetClassLong (pWinPriv->hWnd, GCL_HICON);
@ -646,7 +650,7 @@ winDestroyWindowsWindow (WindowPtr pWin)
/* Null our handle to the Window so referencing it will cause an error */
pWinPriv->hWnd = NULL;
/* Process all messages on our queue */
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
@ -672,6 +676,8 @@ winDestroyWindowsWindow (WindowPtr pWin)
winDestroyIcon(hiconSmClass);
}
winInDestroyWindowsWindow = oldstate;
#if CYGMULTIWINDOW_DEBUG
ErrorF ("-winDestroyWindowsWindow\n");
#endif

View File

@ -265,13 +265,17 @@ ValidateSizing (HWND hwnd, WindowPtr pWin,
return TRUE;
}
extern Bool winInDestroyWindowsWindow;
static void winRaiseWindow(WindowPtr pWin)
{
if (!winInDestroyWindowsWindow)
{
/* Call configure window directly to make sure it gets processed
* in time
*/
XID vlist[1] = { 0 };
XID vlist[1] = { 0 };
ConfigureWindow(pWin, CWStackMode, vlist, NULL);
}
}