From 9da3b23643e848b5073602a7f6e1b27b783f0a1f Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 31 Oct 2022 12:00:13 +0300 Subject: [PATCH] win32u: Move NtUserDragDetect() to window.c. Signed-off-by: Nikolay Sivov --- dlls/win32u/input.c | 45 -------------------------------------------- dlls/win32u/window.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index f3b724e7010..5ba7d151f57 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1394,51 +1394,6 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info ) return TRUE; } -/******************************************************************* - * NtUserDragDetect (win32u.@) - */ -BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) -{ - WORD width, height; - RECT rect; - MSG msg; - - TRACE( "%p (%d,%d)\n", hwnd, x, y ); - - if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE; - - width = get_system_metrics( SM_CXDRAG ); - height = get_system_metrics( SM_CYDRAG ); - SetRect( &rect, x - width, y - height, x + width, y + height ); - - NtUserSetCapture( hwnd ); - - for (;;) - { - while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE )) - { - if (msg.message == WM_LBUTTONUP) - { - release_capture(); - return FALSE; - } - if (msg.message == WM_MOUSEMOVE) - { - POINT tmp; - tmp.x = (short)LOWORD( msg.lParam ); - tmp.y = (short)HIWORD( msg.lParam ); - if (!PtInRect( &rect, tmp )) - { - release_capture(); - return TRUE; - } - } - } - NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ); - } - return FALSE; -} - /********************************************************************** * set_capture_window */ diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1672c4b02a0..27d4f63272d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5540,6 +5540,51 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) } } +/******************************************************************* + * NtUserDragDetect (win32u.@) + */ +BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) +{ + WORD width, height; + RECT rect; + MSG msg; + + TRACE( "%p (%d,%d)\n", hwnd, x, y ); + + if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE; + + width = get_system_metrics( SM_CXDRAG ); + height = get_system_metrics( SM_CYDRAG ); + SetRect( &rect, x - width, y - height, x + width, y + height ); + + NtUserSetCapture( hwnd ); + + for (;;) + { + while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE )) + { + if (msg.message == WM_LBUTTONUP) + { + release_capture(); + return FALSE; + } + if (msg.message == WM_MOUSEMOVE) + { + POINT tmp; + tmp.x = (short)LOWORD( msg.lParam ); + tmp.y = (short)HIWORD( msg.lParam ); + if (!PtInRect( &rect, tmp )) + { + release_capture(); + return TRUE; + } + } + } + NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ); + } + return FALSE; +} + /******************************************************************* * NtUserDragObject (win32u.@) */