Commit 5bb4e4b3 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

user32: Support undocumented SC_SIZE flag that can be used to move window.

Fixes main window moving in Quicken 2020. Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 992e3055
......@@ -11800,6 +11800,45 @@ static void other_process_proc(HWND hwnd)
CloseHandle(test_done_event);
}
static void test_SC_SIZE(void)
{
HWND hwnd;
RECT rect;
MSG msg;
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE,
100, 100, 100, 100, 0, 0, NULL, NULL);
ok(!!hwnd, "CreateWindowEx failed.\n");
GetWindowRect(hwnd, &rect);
ok(rect.left == 100, "rect.left = %d\n", rect.left);
ok(rect.top == 100, "rect.top = %d\n", rect.top);
ok(rect.right == 200, "rect.right = %d\n", rect.right);
ok(rect.bottom == 200, "rect.bottom = %d\n", rect.bottom);
SetCursorPos(100, 100);
PostMessageA(hwnd, WM_SYSCOMMAND, SC_SIZE | 9, MAKELONG(100, 100));
SetCursorPos(110, 100);
PostMessageA(hwnd, WM_MOUSEMOVE, 0, MAKELONG(110, 100));
PostMessageA(hwnd, WM_KEYDOWN, VK_RETURN, 0);
while (GetMessageA(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
DispatchMessageA(&msg);
if (msg.message == WM_SYSCOMMAND) break;
}
GetWindowRect(hwnd, &rect);
ok(rect.left == 110, "rect.left = %d\n", rect.left);
ok(rect.top == 100, "rect.top = %d\n", rect.top);
ok(rect.right == 210, "rect.right = %d\n", rect.right);
ok(rect.bottom == 200, "rect.bottom = %d\n", rect.bottom);
DestroyWindow(hwnd);
}
static void test_other_process_window(const char *argv0)
{
HANDLE window_ready_event, test_done_event;
......@@ -12022,6 +12061,7 @@ START_TEST(win)
test_window_placement();
test_arrange_iconic_windows();
test_other_process_window(argv[0]);
test_SC_SIZE();
/* add the tests above this line */
if (hhook) UnhookWindowsHookEx(hhook);
......
......@@ -2894,7 +2894,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
else
{
if (!DragFullWindows) draw_moving_frame( parent, hdc, &sizingRect, thickframe );
if (hittest == HTCAPTION) OffsetRect( &sizingRect, dx, dy );
if (hittest == HTCAPTION || hittest == HTBORDER) OffsetRect( &sizingRect, dx, dy );
if (ON_LEFT_BORDER(hittest)) sizingRect.left += dx;
else if (ON_RIGHT_BORDER(hittest)) sizingRect.right += dx;
if (ON_TOP_BORDER(hittest)) sizingRect.top += dy;
......@@ -2902,7 +2902,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
capturePoint = pt;
/* determine the hit location */
if (syscommand == SC_SIZE)
if (syscommand == SC_SIZE && hittest != HTBORDER)
{
WPARAM wpSizingHit = 0;
......
......@@ -2851,6 +2851,7 @@ LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
case WMSZ_BOTTOM: dir = _NET_WM_MOVERESIZE_SIZE_BOTTOM; break;
case WMSZ_BOTTOMLEFT: dir = _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT; break;
case WMSZ_BOTTOMRIGHT: dir = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT; break;
case 9: dir = _NET_WM_MOVERESIZE_MOVE; break;
default: dir = _NET_WM_MOVERESIZE_SIZE_KEYBOARD; break;
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment