diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-06-19 21:14:37 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-10-16 20:59:40 +0100 |
commit | 6bf05458310b6ac7f12da66b59cb100488dc9a7f (patch) | |
tree | bc6dd0eec3cbe4385dfefad34d7ccc842deb6c3c | |
parent | a1f055b517073727bb102b6997a7a9922e5a4230 (diff) |
Hint handling fixes
Respect the systems ownership of the clipping region
When the style changes, adjust the window size so the client area remains the same.
Otherwise the window size may change when sizing is reflected from
Windows to X, and some windows are drawn expecting them to be exactly the reqeusted size
(e.g. gmplayer control window)
Use the current style in determining the window border when validating which sizing
XXX: Needs to allow for different border thickness when uncaptioned?
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r-- | hw/xwin/winmultiwindowshape.c | 14 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c index 44007027a..28870646c 100644 --- a/hw/xwin/winmultiwindowshape.c +++ b/hw/xwin/winmultiwindowshape.c @@ -71,6 +71,9 @@ winUpdateRgnMultiWindow (WindowPtr pWin) { SetWindowRgn (winGetWindowPriv(pWin)->hWnd, winGetWindowPriv(pWin)->hRgn, TRUE); + + /* The system now owns the region specified by the region handle and delete it when it is no longer needed. */ + winGetWindowPriv(pWin)->hRgn = NULL; } @@ -206,3 +209,14 @@ winReshapeMultiWindow (WindowPtr pWin) return; } + +void +winShapeRgnUpdateMultiwindow(HWND hwnd) +{ + WindowPtr pWin = GetProp (hwnd, WIN_WINDOW_PROP); + if (pWin) + { + winReshapeMultiWindow(pWin); + winUpdateRgnMultiWindow(pWin); + } +} diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 7f66f86bc..364cf335a 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -1016,6 +1016,17 @@ winTopLevelWindowProc (HWND hwnd, UINT message, if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow(); return 0; /* end of WM_SIZE handler */ + case WM_STYLECHANGED: + /* when the style changes, adjust the window size so the client area remains the same */ + { + LONG x,y; + DrawablePtr pDraw = &pWin->drawable; + x = pDraw->x - wBorderWidth(pWin); + y = pDraw->y - wBorderWidth(pWin); + winPositionWindowMultiWindow(pWin, x, y); + } + return 0; + case WM_MOUSEACTIVATE: /* Check if this window needs to be made active when clicked */ |