diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2005-01-27 13:27:02 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2005-01-27 13:27:02 +0000 |
commit | 4d6b61e2f35d5322867ae76da599327213d198be (patch) | |
tree | 72f75d7da76647863b855762ef72455d7eee98de | |
parent | c2be8fbc91d0c14ec9cb00b8d8dd1f7b447b3ca6 (diff) |
Fixes for window ordering problem (updated) (Kensuke Matsuzaki)
-rw-r--r-- | hw/xwin/ChangeLog | 5 | ||||
-rwxr-xr-x | hw/xwin/winmultiwindowwndproc.c | 60 |
2 files changed, 65 insertions, 0 deletions
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog index f303cb6ff..73c9eb5f1 100644 --- a/hw/xwin/ChangeLog +++ b/hw/xwin/ChangeLog @@ -1,5 +1,10 @@ 2005-01-27 Alexander Gottwald <ago at freedesktop dot org> + * winmultiwindowwndproc.c: + Fixes for window ordering problem (updated) (Kensuke Matsuzaki) + +2005-01-27 Alexander Gottwald <ago at freedesktop dot org> + * winconfig.c: Added hungarian keyboard layout. diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 3ebd0be7d..494973b1a 100755 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -953,6 +953,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, return ValidateSizing (hwnd, pWin, wParam, lParam); case WM_WINDOWPOSCHANGING: +#if 0 if (lParam != 0) { WINDOWPOS *windowpos = (WINDOWPOS *)lParam; @@ -989,8 +990,67 @@ winTopLevelWindowProc (HWND hwnd, UINT message, winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg); } } +#endif break; case WM_WINDOWPOSCHANGED: + { + LPWINDOWPOS pWinPos = (LPWINDOWPOS) lParam; + + if (!(pWinPos->flags & SWP_NOZORDER)) + { +#if CYGWINDOWING_DEBUG + winDebug ("\twindow z order was changed\n"); +#endif + if (pWinPos->hwndInsertAfter == HWND_TOP + ||pWinPos->hwndInsertAfter == HWND_TOPMOST + ||pWinPos->hwndInsertAfter == HWND_NOTOPMOST) + { +#if CYGWINDOWING_DEBUG + winDebug ("\traise to top\n"); +#endif + /* Raise the window to the top in Z order */ + wmMsg.msg = WM_WM_RAISE; + if (fWMMsgInitialized) + winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg); + } + else if (pWinPos->hwndInsertAfter == HWND_BOTTOM) + { + } + else + { + /* Check if this window is top of X windows. */ + HWND hWndAbove = NULL; + DWORD dwCurrentProcessID = GetCurrentProcessId (); + DWORD dwWindowProcessID = 0; + + for (hWndAbove = pWinPos->hwndInsertAfter; + hWndAbove != NULL; + hWndAbove = GetNextWindow (hWndAbove, GW_HWNDPREV)) + { + /* Ignore other XWin process's window */ + GetWindowThreadProcessId (hWndAbove, &dwWindowProcessID); + + if ((dwWindowProcessID == dwCurrentProcessID) + && GetProp (hWndAbove, WIN_WINDOW_PROP) + && !IsWindowVisible (hWndAbove) + && !IsIconic (hWndAbove) ) /* ignore minimized windows */ + break; + } + /* If this is top of X windows in Windows stack, + raise it in X stack. */ + if (hWndAbove == NULL) + { +#if CYGWINDOWING_DEBUG + winDebug ("\traise to top\n"); +#endif + /* Raise the window to the top in Z order */ + wmMsg.msg = WM_WM_RAISE; + if (fWMMsgInitialized) + winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg); + } + } + } + } /* * Pass the message to DefWindowProc to let the function * break down WM_WINDOWPOSCHANGED to WM_MOVE and WM_SIZE. |