Commit c7e0697e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move WM_WINDOWPOSCHANGED implementation from user32.

parent 3ec9c299
...@@ -39,35 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); ...@@ -39,35 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
#define DRAG_FILE 0x454C4946 #define DRAG_FILE 0x454C4946
/*********************************************************************** /***********************************************************************
* DEFWND_HandleWindowPosChanged
*
* Handle the WM_WINDOWPOSCHANGED message.
*/
static void DEFWND_HandleWindowPosChanged( HWND hwnd, const WINDOWPOS *winpos )
{
RECT rect;
WIN_GetRectangles( hwnd, COORDS_PARENT, NULL, &rect );
if (!(winpos->flags & SWP_NOCLIENTMOVE))
SendMessageW( hwnd, WM_MOVE, 0, MAKELONG(rect.left, rect.top));
if (!(winpos->flags & SWP_NOCLIENTSIZE) || (winpos->flags & SWP_STATECHANGED))
{
if (IsIconic( hwnd ))
{
SendMessageW( hwnd, WM_SIZE, SIZE_MINIMIZED, 0 );
}
else
{
WPARAM wp = IsZoomed( hwnd ) ? SIZE_MAXIMIZED : SIZE_RESTORED;
SendMessageW( hwnd, WM_SIZE, wp, MAKELONG(rect.right-rect.left, rect.bottom-rect.top) );
}
}
}
/***********************************************************************
* DEFWND_ControlColor * DEFWND_ControlColor
* *
* Default colors for control painting. * Default colors for control painting.
...@@ -158,10 +129,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -158,10 +129,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_NCMOUSELEAVE: case WM_NCMOUSELEAVE:
return NC_HandleNCMouseLeave( hwnd ); return NC_HandleNCMouseLeave( hwnd );
case WM_WINDOWPOSCHANGED:
DEFWND_HandleWindowPosChanged( hwnd, (const WINDOWPOS *)lParam );
break;
case WM_RBUTTONUP: case WM_RBUTTONUP:
{ {
POINT pt; POINT pt;
......
...@@ -489,6 +489,29 @@ static LONG handle_window_pos_changing( HWND hwnd, WINDOWPOS *winpos ) ...@@ -489,6 +489,29 @@ static LONG handle_window_pos_changing( HWND hwnd, WINDOWPOS *winpos )
return 0; return 0;
} }
static void handle_window_pos_changed( HWND hwnd, const WINDOWPOS *winpos )
{
RECT rect;
get_window_rects( hwnd, COORDS_PARENT, NULL, &rect, get_thread_dpi() );
if (!(winpos->flags & SWP_NOCLIENTMOVE))
send_message( hwnd, WM_MOVE, 0, MAKELONG( rect.left, rect.top ));
if (!(winpos->flags & SWP_NOCLIENTSIZE) || (winpos->flags & SWP_STATECHANGED))
{
if (is_iconic( hwnd ))
{
send_message( hwnd, WM_SIZE, SIZE_MINIMIZED, 0 );
}
else
{
WPARAM wp = is_zoomed( hwnd ) ? SIZE_MAXIMIZED : SIZE_RESTORED;
send_message( hwnd, WM_SIZE, wp,
MAKELONG( rect.right-rect.left, rect.bottom-rect.top ));
}
}
}
/*********************************************************************** /***********************************************************************
* draw_moving_frame * draw_moving_frame
* *
...@@ -2324,6 +2347,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, ...@@ -2324,6 +2347,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
case WM_WINDOWPOSCHANGING: case WM_WINDOWPOSCHANGING:
return handle_window_pos_changing( hwnd, (WINDOWPOS *)lparam ); return handle_window_pos_changing( hwnd, (WINDOWPOS *)lparam );
case WM_WINDOWPOSCHANGED:
handle_window_pos_changed( hwnd, (const WINDOWPOS *)lparam );
break;
case WM_PAINTICON: case WM_PAINTICON:
case WM_PAINT: case WM_PAINT:
{ {
......
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