diff -U3 xwin.cvs/winmultiwindowwindow.c xwin/winmultiwindowwindow.c --- xwin.cvs/winmultiwindowwindow.c 2004-01-25 19:04:11.578125000 -0800 +++ xwin/winmultiwindowwindow.c 2004-01-25 19:30:38.218750000 -0800 @@ -105,7 +105,8 @@ pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen); pWinPriv->fXKilled = FALSE; pWinPriv->fNeedRestore = FALSE; - + pWinPriv->fAlwaysOnTop = FALSE; + return fResult; } diff -U3 xwin.cvs/winmultiwindowwndproc.c xwin/winmultiwindowwndproc.c --- xwin.cvs/winmultiwindowwndproc.c 2004-01-25 19:04:11.609375000 -0800 +++ xwin/winmultiwindowwndproc.c 2004-01-25 19:55:45.859375000 -0800 @@ -387,6 +387,22 @@ /* * Any window menu items go through here */ + /* If minimizing then remove always-on-top, and store the setting */ + if (wParam == SC_MINIMIZE) + { + if (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST) + pWinPriv->fAlwaysOnTop = TRUE; + else + pWinPriv->fAlwaysOnTop = FALSE; + SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, + SWP_NOMOVE|SWP_NOSIZE); + } + else if (wParam == SC_RESTORE) + { + if (pWinPriv->fAlwaysOnTop) + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, + SWP_NOMOVE|SWP_NOSIZE); + } HandleCustomWM_COMMAND ((unsigned long)hwnd, LOWORD(wParam)); break; @@ -893,7 +909,7 @@ if (s_pScreenPriv != NULL) s_pScreenPriv->fWindowOrderChanged = TRUE; } - return 0; + break; case WM_SIZE: /* see dix/window.c */ diff -U3 xwin.cvs/winwindow.h xwin/winwindow.h --- xwin.cvs/winwindow.h 2004-01-25 19:04:12.187500000 -0800 +++ xwin/winwindow.h 2004-01-25 19:06:40.281250000 -0800 @@ -75,6 +75,7 @@ Bool fXKilled; Bool fNeedRestore; POINT ptRestore; + Bool fAlwaysOnTop; /* Privates used by primary fb DirectDraw server */ LPDDSURFACEDESC pddsdPrimary;