From 8653db5d57199d53c9b2b993c35a7b70c8949989 Mon Sep 17 00:00:00 2001 From: Alexander Gottwald Date: Thu, 10 Mar 2005 20:05:46 +0000 Subject: [PATCH] Force rebuilding of window stack if a window changes it's state from minimized. --- hw/xwin/ChangeLog | 6 ++++++ hw/xwin/winmultiwindowwndproc.c | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog index 6f4e097..ed7f7b2 100644 --- a/hw/xwin/ChangeLog +++ b/hw/xwin/ChangeLog @@ -1,3 +1,9 @@ +2005-03-10 Alexander Gottwald + + * winmultiwindowwndproc.c: + Force rebuilding of window stack if a window changes it's state from + minimized. + 2005-03-07 Alexander Gottwald * winmultiwindowwndproc.c: diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 3987511..a732d53 100755 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -301,6 +301,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, winWMMessageRec wmMsg; Bool fWMMsgInitialized = FALSE; static Bool s_fTracking = FALSE; + Bool needRestack = FALSE; + LRESULT ret; #if CYGDEBUG winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam); @@ -403,6 +405,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Don't pass customized menus to DefWindowProc */ return 0; } + if (wParam == SC_RESTORE || wParam == SC_MAXIMIZE) + { + WINDOWPLACEMENT wndpl; + wndpl.length = sizeof(wndpl); + if (GetWindowPlacement(hwnd, &wndpl) && wndpl.showCmd == SW_SHOWMINIMIZED) + needRestack = TRUE; + } break; case WM_INITMENU: @@ -1010,5 +1019,12 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; } - return DefWindowProc (hwnd, message, wParam, lParam); + ret = DefWindowProc (hwnd, message, wParam, lParam); + /* + * If the window was minized we get the stack change before the window is restored + * and so it gets lost. Ensure there stacking order is correct. + */ + if (needRestack) + winReorderWindowsMultiWindow(); + return ret; } -- 2.7.4