Call winReorderWindowMultiWindow from winTopLevelWindowProc/WM_SETFOCUS

handler instead of winBlockHandler. Because it is an optimization, it
    should not change visible behaviour while performance and simplicity
    are improved.
This commit is contained in:
Takuma Murakami 2004-03-06 08:43:55 +00:00
parent 3da304bf5d
commit 7554a68461
4 changed files with 28 additions and 52 deletions

View file

@ -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 */

View file

@ -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);

View file

@ -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;
}

View file

@ -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.