diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-03-12 14:41:51 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-03-12 14:41:51 +0000 |
commit | 0c6c47ecd1fa99971ca6853337fc9cb888bc6049 (patch) | |
tree | 746be177b035fc1d2aa20e66f55cb20addbed929 /hw/xwin/winmultiwindowwndproc.c | |
parent | b1be72c5ca6cb98ba64637990b142be0f1710a19 (diff) | |
parent | ea0598773ec2859df09ae62f027db6ee611f51c0 (diff) |
Merge branch 'cygwin-patches-for-1.12' into cygwin-release-1.12xserver-cygwin-1.12.0-1
Diffstat (limited to 'hw/xwin/winmultiwindowwndproc.c')
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 65 |
1 files changed, 62 insertions, 3 deletions
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 19dad579c..3c0fc34cc 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -321,6 +321,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, static Bool s_fTracking = FALSE; Bool needRestack = FALSE; LRESULT ret; + static Bool hasEnteredSizeMove = FALSE; #if CYGDEBUG winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam); @@ -834,6 +835,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; case WM_CLOSE: + /* Remove property AppUserModelID */ + winSetAppID (hwnd, NULL); + /* Branch on if the window was killed in X already */ if (pWinPriv->fXKilled) { @@ -870,7 +874,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, case WM_MOVE: /* Adjust the X Window to the moved Windows window */ - winAdjustXWindow (pWin, hwnd); + if (!hasEnteredSizeMove) winAdjustXWindow (pWin, hwnd); + /* else: Wait for WM_EXITSIZEMOVE */ return 0; case WM_SHOWWINDOW: @@ -1011,6 +1016,16 @@ winTopLevelWindowProc (HWND hwnd, UINT message, */ break; + case WM_ENTERSIZEMOVE: + hasEnteredSizeMove = TRUE; + return 0; + + case WM_EXITSIZEMOVE: + /* Adjust the X Window to the moved Windows window */ + hasEnteredSizeMove = FALSE; + winAdjustXWindow (pWin, hwnd); + return 0; + case WM_SIZE: /* see dix/window.c */ #if CYGWINDOWING_DEBUG @@ -1035,8 +1050,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message, (int)(GetTickCount ())); } #endif - /* Adjust the X Window to the moved Windows window */ - winAdjustXWindow (pWin, hwnd); + if (!hasEnteredSizeMove) + { + /* Adjust the X Window to the moved Windows window */ + winAdjustXWindow (pWin, hwnd); + if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow(); + } + /* else: wait for WM_EXITSIZEMOVE */ return 0; /* end of WM_SIZE handler */ case WM_STYLECHANGING: @@ -1133,3 +1153,42 @@ winTopLevelWindowProc (HWND hwnd, UINT message, winReorderWindowsMultiWindow(); return ret; } + +/* + * winChildWindowProc - Window procedure for all top-level Windows windows. + */ + +LRESULT CALLBACK +winChildWindowProc (HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam) +{ +#if CYGDEBUG + winDebugWin32Message("winChildWindowProc", hwnd, message, wParam, lParam); +#endif + + switch (message) + { + case WM_ERASEBKGND: + return TRUE; + + case WM_PAINT: + /* + We don't have the bits to draw into the window, they went straight into the OpenGL + surface + + XXX: For now, just leave it alone, but ideally we want to send an expose event to + the window so it really redraws the affected region... + */ + { + PAINTSTRUCT ps; + HDC hdcUpdate; + hdcUpdate = BeginPaint(hwnd, &ps); + ValidateRect(hwnd, &(ps.rcPaint)); + EndPaint(hwnd, &ps); + return 0; + } + /* XXX: this is exactly what DefWindowProc does? */ + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} |