From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/user32/controls.h | 1 - dlls/user32/defwnd.c | 3 --- dlls/user32/nonclient.c | 34 ---------------------------------- dlls/win32u/defwnd.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index eec6a4babe2..d4e8ccd7b08 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -123,7 +123,6 @@ extern HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCMouseLeave( HWND hwnd ) DECLSPEC_HIDDEN; -extern LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN; extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index 0c783666b7e..a0d6ca44ecb 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -181,9 +181,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_NCLBUTTONDBLCLK: return NC_HandleNCLButtonDblClk( hwnd, wParam, lParam );
- case WM_NCRBUTTONDOWN: - return NC_HandleNCRButtonDown( hwnd, wParam, lParam ); - case WM_RBUTTONUP: { POINT pt; diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 128f633fa33..174f6e46977 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -717,40 +717,6 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt ) }
-/*********************************************************************** - * NC_HandleNCRButtonDown - * - * Handle a WM_NCRBUTTONDOWN message. Called from DefWindowProc(). - */ -LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) -{ - MSG msg; - INT hittest = wParam; - - switch (hittest) - { - case HTCAPTION: - case HTSYSMENU: - NtUserSetCapture( hwnd ); - for (;;) - { - if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break; - if (NtUserCallMsgFilter( &msg, MSGF_MAX )) continue; - if (msg.message == WM_RBUTTONUP) - { - hittest = NC_HandleNCHitTest( hwnd, msg.pt ); - break; - } - } - ReleaseCapture(); - if (hittest == HTCAPTION || hittest == HTSYSMENU) - SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELPARAM(msg.pt.x, msg.pt.y)); - break; - } - return 0; -} - - /*********************************************************************** * NC_HandleNCLButtonDblClk * diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 780570b5ad4..7126d492c78 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -1961,6 +1961,34 @@ static LRESULT handle_nc_lbutton_down( HWND hwnd, WPARAM wparam, LPARAM lparam ) return 0; }
+static LRESULT handle_nc_rbutton_down( HWND hwnd, WPARAM wparam, LPARAM lparam ) +{ + int hittest = wparam; + MSG msg; + + switch (hittest) + { + case HTCAPTION: + case HTSYSMENU: + NtUserSetCapture( hwnd ); + for (;;) + { + if (!NtUserGetMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break; + if (NtUserCallMsgFilter( &msg, MSGF_MAX )) continue; + if (msg.message == WM_RBUTTONUP) + { + hittest = handle_nc_hit_test( hwnd, msg.pt ); + break; + } + } + release_capture(); + if (hittest == HTCAPTION || hittest == HTSYSMENU) + send_message( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELPARAM( msg.pt.x, msg.pt.y )); + break; + } + return 0; +} + LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi ) { LRESULT result = 0; @@ -2009,6 +2037,9 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, case WM_NCLBUTTONDOWN: return handle_nc_lbutton_down( hwnd, wparam, lparam );
+ case WM_NCRBUTTONDOWN: + return handle_nc_rbutton_down( hwnd, wparam, lparam ); + case WM_WINDOWPOSCHANGING: return handle_window_pos_changing( hwnd, (WINDOWPOS *)lparam );