diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-07-07 20:51:34 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-10-20 13:59:09 +0100 |
commit | f6f480bc0055ffa6295953273e590432659d2d18 (patch) | |
tree | 61de094b1330b6115e7ad644558c078fb0ebaeec | |
parent | 5347927fb0f200a0f89c702bcb400506600cf136 (diff) |
Cygwin/X: Unmap minimized windows in rootless modes
At the moment, when a window is minimized, it is moved to (0,0) on the shadow
framebuffer. This can leads to various problems: tooltips and menus can 'punch
through' from an apparently minimized window if the mouse pointer is positioned
over the native frame of another X window which covers the sensitive regions of
the apparently minimized window. I think may also be leading to some repainting
glitches when uncovering areas covered by native window frames.
So, don't move minimized windows to (0,0), simply unmap them.
This has the disadvantage that the contents of windows which are minimized are
no longer stored in the shadow frame buffer, so must be redrawn when restored,
but I assume they were being re-exposed when restored, anyhow...
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r-- | hw/xwin/winmultiwindowwindow.c | 10 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwm.c | 3 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 29 |
3 files changed, 32 insertions, 10 deletions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index e4f4d82b7..990a05f92 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -326,12 +326,6 @@ winUnmapWindowMultiWindow (WindowPtr pWin) WIN_UNWRAP(UnrealizeWindow); fResult = (*pScreen->UnrealizeWindow)(pWin); WIN_WRAP(UnrealizeWindow, winUnmapWindowMultiWindow); - - /* Flag that the window has been killed */ - pWinPriv->fXKilled = TRUE; - - /* Destroy the Windows window associated with this X window */ - winDestroyWindowsWindow (pWin); return fResult; } @@ -924,9 +918,7 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd) * If the Windows window is minimized, its WindowRect has * meaningless values so we don't adjust X window to it. */ - vlist[0] = 0; - vlist[1] = 0; - return ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin)); + return 0; } pDraw = &pWin->drawable; diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index dba3ca37e..a7463eae8 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -715,6 +715,9 @@ winMultiWindowWMProc (void *pArg) UpdateName (pWMInfo, pNode->msg.iWindow); winUpdateIcon (pNode->msg.iWindow); + /* Map the window */ + XMapWindow(pWMInfo->pDisplay, pNode->msg.iWindow); + break; case WM_WM_MAP2: diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index a088a49be..4ffebc8d0 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -1008,7 +1008,34 @@ winTopLevelWindowProc (HWND hwnd, UINT message, #endif /* Adjust the X Window to the moved Windows window */ winAdjustXWindow (pWin, hwnd); - if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow(); + + switch (wParam) + { + case SIZE_MINIMIZED: + { + wmMsg.msg = WM_WM_UNMAP; + /* Tell our Window Manager thread to unmap the window */ + if (fWMMsgInitialized) + winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg); + + winReorderWindowsMultiWindow(); + + break; + } + case SIZE_RESTORED: + case SIZE_MAXIMIZED: + { + wmMsg.msg = WM_WM_MAP; + /* Tell our Window Manager thread to map the window */ + if (fWMMsgInitialized) + winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg); + + winReorderWindowsMultiWindow(); + + break; + } + } + return 0; /* end of WM_SIZE handler */ case WM_STYLECHANGED: |