diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 700e60db17ec9bc268fb2a6f82956b0773c28ea3..843da8900f12e9122409265ce7e3d40bcf43aa66 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -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); diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index b92a20df18ba820dcbc0e3d55d6171dbf76252e6..b45b74ce82e20d5b0d16c08bd824a24be2a34366 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -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; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a16b8354245bc9b9b789470f3e451511ab75cd2e..f4920b802e2d0f05ea71594c03402650fd3b1dee 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -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;