Commit 19e8cc96 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move WM_NCLBUTTONDBLCLK and WM_LBUTTONDBLCLK implementation from user32.

parent bdae778e
......@@ -121,7 +121,6 @@ extern HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu ) DECLSPEC_HIDDEN;
/* nonclient area */
extern LRESULT NC_HandleNCMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleNCMouseLeave( HWND hwnd ) 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;
/* scrollbar */
......
......@@ -175,12 +175,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
iF10Key = iMenuSysKey = 0;
break;
case WM_LBUTTONDBLCLK:
return NC_HandleNCLButtonDblClk( hwnd, HTCLIENT, lParam );
case WM_NCLBUTTONDBLCLK:
return NC_HandleNCLButtonDblClk( hwnd, wParam, lParam );
case WM_RBUTTONUP:
{
POINT pt;
......
......@@ -261,57 +261,6 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
/***********************************************************************
* NC_HandleNCLButtonDblClk
*
* Handle a WM_NCLBUTTONDBLCLK message. Called from DefWindowProc().
*/
LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam )
{
/*
* if this is an icon, send a restore since we are handling
* a double click
*/
if (IsIconic(hwnd))
{
SendMessageW( hwnd, WM_SYSCOMMAND, SC_RESTORE, lParam );
return 0;
}
switch(wParam) /* Hit test */
{
case HTCAPTION:
/* stop processing if WS_MAXIMIZEBOX is missing */
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MAXIMIZEBOX)
SendMessageW( hwnd, WM_SYSCOMMAND,
IsZoomed(hwnd) ? SC_RESTORE : SC_MAXIMIZE, lParam );
break;
case HTSYSMENU:
{
HMENU hSysMenu = NtUserGetSystemMenu(hwnd, FALSE);
UINT state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
/* If the close item of the sysmenu is disabled or not present do nothing */
if ((state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF))
break;
SendMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, lParam );
break;
}
case HTHSCROLL:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
break;
case HTVSCROLL:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
break;
}
return 0;
}
/***********************************************************************
* NC_HandleSysCommand
*
* Handle a WM_SYSCOMMAND message. Called from DefWindowProc().
......
......@@ -2169,6 +2169,48 @@ static LRESULT handle_nc_rbutton_down( HWND hwnd, WPARAM wparam, LPARAM lparam )
return 0;
}
static LRESULT handle_nc_button_dbl_click( HWND hwnd, WPARAM wparam, LPARAM lparam )
{
/* if this is an icon, send a restore since we are handling a double click */
if (is_iconic(hwnd))
{
send_message( hwnd, WM_SYSCOMMAND, SC_RESTORE, lparam );
return 0;
}
switch (wparam) /* Hit test */
{
case HTCAPTION:
/* stop processing if WS_MAXIMIZEBOX is missing */
if (get_window_long( hwnd, GWL_STYLE ) & WS_MAXIMIZEBOX)
send_message( hwnd, WM_SYSCOMMAND,
is_zoomed( hwnd ) ? SC_RESTORE : SC_MAXIMIZE, lparam );
break;
case HTSYSMENU:
{
HMENU hSysMenu = NtUserGetSystemMenu( hwnd, FALSE );
UINT state = get_menu_state( hSysMenu, SC_CLOSE, MF_BYCOMMAND );
/* If the close item of the sysmenu is disabled or not present do nothing */
if ((state & (MF_DISABLED | MF_GRAYED)) || state == 0xffffffff)
break;
send_message( hwnd, WM_SYSCOMMAND, SC_CLOSE, lparam );
break;
}
case HTHSCROLL:
send_message( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lparam );
break;
case HTVSCROLL:
send_message( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lparam );
break;
}
return 0;
}
LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi )
{
LRESULT result = 0;
......@@ -2220,6 +2262,12 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
case WM_NCRBUTTONDOWN:
return handle_nc_rbutton_down( hwnd, wparam, lparam );
case WM_LBUTTONDBLCLK:
return handle_nc_button_dbl_click( hwnd, HTCLIENT, lparam );
case WM_NCLBUTTONDBLCLK:
return handle_nc_button_dbl_click( hwnd, wparam, lparam );
case WM_CONTEXTMENU:
if (get_window_long( hwnd, GWL_STYLE ) & WS_CHILD)
send_message( get_parent( hwnd ), msg, (WPARAM)hwnd, lparam );
......
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