diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 994e12b99..9f0de66d8 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -508,7 +508,7 @@ typedef struct _winPrivScreenRec /* Privates used by both multi-window and rootless */ Bool fRootWindowShown; Bool fRestacking; - Bool fWindowOrderChanged; + Bool fWindowOrderChanged; /* Only for rootless */ #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Privates used for any module running in a seperate thread */ diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c index 941c2b53c..589aae493 100644 --- a/hw/xwin/winblock.c +++ b/hw/xwin/winblock.c @@ -88,11 +88,6 @@ winBlockHandler_ProcessMessages: } } -#ifdef XWIN_MULTIWINDOW - if (pScreenPriv->pScreenInfo->fMultiWindow) - winReorderWindowsMultiWindow ((ScreenPtr)pBlockData); -#endif - #ifdef XWIN_MULTIWINDOWEXTWM if (pScreenPriv->pScreenInfo->fMWExtWM) winMWExtWMReorderWindows ((ScreenPtr)pBlockData); diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 30870e70e..3c23248c9 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -737,7 +737,9 @@ winFindWindow (pointer value, XID id, pointer cdata) /* - * winReorderWindowsMultiWindow - + * winReorderWindowsMultiWindow - + * + * Change X windows' Z orders with respect to their Windows counterparts. */ void @@ -754,48 +756,41 @@ winReorderWindowsMultiWindow (ScreenPtr pScreen) #if CYGMULTIWINDOW_DEBUG ErrorF ("winReorderWindowsMultiWindow\n"); #endif - + pScreenPriv->fRestacking = TRUE; - if (pScreenPriv->fWindowOrderChanged) + hwnd = GetTopWindow (NULL); + + while (hwnd) { -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winReorderWindowsMultiWindow - Need to restack\n"); -#endif - hwnd = GetTopWindow (NULL); + GetWindowThreadProcessId (hwnd, &dwWindowProcessID); - while (hwnd) + if ( (dwWindowProcessID == dwCurrentProcessID) + && GetProp (hwnd, WIN_WINDOW_PROP) + && !IsIconic (hwnd) ) /* ignore minimized windows */ { - GetWindowThreadProcessId (hwnd, &dwWindowProcessID); - - if ( (dwWindowProcessID == dwCurrentProcessID) - && GetProp (hwnd, WIN_WINDOW_PROP) - && !IsIconic (hwnd) ) /* ignore minimized windows */ - { - pWinSib = pWin; - pWin = GetProp (hwnd, WIN_WINDOW_PROP); + pWinSib = pWin; + pWin = GetProp (hwnd, WIN_WINDOW_PROP); - if (!pWinSib) - { /* 1st window - raise to the top */ - vlist[0] = Above; + if (!pWinSib) + { /* 1st window - raise to the top */ + vlist[0] = Above; - ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin)); - } - else - { /* 2nd or deeper windows - just below the previous one */ - vlist[0] = winGetWindowID (pWinSib); - vlist[1] = Below; - - ConfigureWindow (pWin, CWSibling | CWStackMode, - vlist, wClient(pWin)); - } + ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin)); + } + else + { /* 2nd or deeper windows - just below the previous one */ + vlist[0] = winGetWindowID (pWinSib); + vlist[1] = Below; + + ConfigureWindow (pWin, CWSibling | CWStackMode, + vlist, wClient(pWin)); } - hwnd = GetNextWindow (hwnd, GW_HWNDNEXT); } + hwnd = GetNextWindow (hwnd, GW_HWNDNEXT); } pScreenPriv->fRestacking = FALSE; - pScreenPriv->fWindowOrderChanged = FALSE; } diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index fc295fbae..1cc9f493f 100755 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -620,6 +620,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; winRestoreModeKeyStates (); + winReorderWindowsMultiWindow (s_pScreen); return 0; case WM_KILLFOCUS: @@ -726,9 +727,6 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Pass the message to the root window */ SendMessage (hwndScreen, message, wParam, lParam); - if (s_pScreenPriv != NULL) - s_pScreenPriv->fWindowOrderChanged = TRUE; - if (LOWORD(wParam) != WA_INACTIVE) { /* Tell our Window Manager thread to activate the window */ @@ -890,8 +888,6 @@ winTopLevelWindowProc (HWND hwnd, UINT message, if (fWMMsgInitialized) winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg); - if (s_pScreenPriv != NULL) - s_pScreenPriv->fWindowOrderChanged = TRUE; return 0; case WM_SIZING: @@ -900,16 +896,6 @@ winTopLevelWindowProc (HWND hwnd, UINT message, return ValidateSizing (hwnd, pWin, wParam, lParam); case WM_WINDOWPOSCHANGED: - if (!( ((LPWINDOWPOS)lParam)->flags - & SWP_NOZORDER )) - { -#if CYGWINDOWING_DEBUG - ErrorF ("winTopLevelWindowProc - WM_WINDOWPOSCHANGED: " - "Z order is changed\n"); -#endif - if (s_pScreenPriv != NULL) - s_pScreenPriv->fWindowOrderChanged = TRUE; - } /* * Pass the message to DefWindowProc to let the function * break down WM_WINDOWPOSCHANGED to WM_MOVE and WM_SIZE.