Fix window reordering. Remove winMWExtWMReorderWindows.

This commit is contained in:
Kensuke Matsuzaki 2004-04-09 05:52:50 +00:00
parent 496313f8f7
commit 52fa100033
4 changed files with 58 additions and 27 deletions

View file

@ -89,9 +89,4 @@ winBlockHandler_ProcessMessages:
DispatchMessage (&msg);
}
}
#ifdef XWIN_MULTIWINDOWEXTWM
if (pScreenPriv->pScreenInfo->fMWExtWM)
winMWExtWMReorderWindows ((ScreenPtr)pBlockData);
#endif
}

View file

@ -67,9 +67,4 @@ winWakeupHandler (int nScreen,
DispatchMessage (&msg);
}
}
#ifdef XWIN_MULTIWINDOWEXTWM
if (pScreenPriv->pScreenInfo->fMWExtWM)
winMWExtWMReorderWindows ((ScreenPtr)pWakeupData);
#endif
}

View file

@ -41,6 +41,7 @@
extern HICON g_hiconX;
#if 0
/*
* winMWExtWMReorderWindows
*/
@ -54,6 +55,7 @@ winMWExtWMReorderWindows (ScreenPtr pScreen)
win32RootlessWindowPtr pRLWinSib = NULL;
DWORD dwCurrentProcessID = GetCurrentProcessId ();
DWORD dwWindowProcessID = 0;
XID vlist[2];
#if CYGMULTIWINDOW_DEBUG && FALSE
ErrorF ("winMWExtWMReorderWindows\n");
@ -80,22 +82,19 @@ winMWExtWMReorderWindows (ScreenPtr pScreen)
if (pRLWinSib)
{
XID *vlist = malloc (sizeof(long) * 2);
if (vlist == NULL)
{
ErrorF ("winMWExtWMReorderWindows - malloc () "
"failed\n");
return;
}
((long*)vlist)[0] = pRLWinSib->pFrame->win->drawable.id;
((long*)vlist)[1] = Below;
vlist[0] = pRLWinSib->pFrame->win->drawable.id;
vlist[1] = Below;
ConfigureWindow (pRLWin->pFrame->win, CWSibling | CWStackMode,
vlist, wClient(pRLWin->pFrame->win));
free (vlist);
}
else
{
/* 1st window - raise to the top */
vlist[0] = Above;
ConfigureWindow (pRLWin->pFrame->win, CWStackMode,
vlist, wClient(pRLWin->pFrame->win));
}
}
hwnd = GetNextWindow (hwnd, GW_HWNDNEXT);
@ -104,8 +103,8 @@ winMWExtWMReorderWindows (ScreenPtr pScreen)
pScreenPriv->fRestacking = FALSE;
pScreenPriv->fWindowOrderChanged = FALSE;
}
#endif
/*

View file

@ -412,6 +412,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
PAINTSTRUCT ps;
LPWINDOWPOS pWinPos = NULL;
RECT rcClient;
XID vlist[2];
/* Check if the Windows window property for our X window pointer is valid */
if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
@ -898,8 +899,48 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
/* Reorder if window z order was changed */
if ((pScreenPriv != NULL)
&& !(pWinPos->flags & SWP_NOZORDER))
pScreenPriv->fWindowOrderChanged = TRUE;
&& !(pWinPos->flags & SWP_NOZORDER)
&& !(pWinPos->flags & SWP_SHOWWINDOW))
{
pScreenPriv->fWindowOrderChanged = TRUE;
if (pWinPos->hwndInsertAfter == HWND_TOP
||pWinPos->hwndInsertAfter == HWND_TOPMOST
||pWinPos->hwndInsertAfter == HWND_NOTOPMOST)
{
vlist[0] = Above;
ConfigureWindow (pWin, CWStackMode,
vlist, wClient(pWin));
}
#if 1
else if (pWinPos->hwndInsertAfter == HWND_BOTTOM)
{
}
else
{
HWND hWndAbove = NULL;
DWORD dwCurrentProcessID = GetCurrentProcessId ();
DWORD dwWindowProcessID = 0;
for (hWndAbove = pWinPos->hwndInsertAfter;
hWndAbove != NULL;
hWndAbove = GetNextWindow (hWndAbove, GW_HWNDPREV))
{
GetWindowThreadProcessId (hWndAbove, &dwWindowProcessID);
if ((dwWindowProcessID == dwCurrentProcessID)
&& GetProp (Above, WIN_WINDOW_PROP)
&& !IsIconic (hwnd) ) /* ignore minimized windows */
break;
}
if (hWndAbove == NULL)
{
vlist[0] = Above;
ConfigureWindow (pWin, CWStackMode,
vlist, wClient(pWin));
}
}
#endif
}
if (!(pWinPos->flags & SWP_NOSIZE)) {
if (IsIconic(hwnd)){
@ -936,7 +977,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
}
if (!g_fNoConfigureWindow ) {
if (!pRLWinPriv->fMovingOrSizing) {
if (!pRLWinPriv->fMovingOrSizing
&& (pWinPos->flags & SWP_SHOWWINDOW)) {
GetClientRect (hwnd, &rcClient);
MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);