mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 20:50:02 +00:00
win32u: Move WM_WINDOWPOSCHANGED implementation from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
This commit is contained in:
parent
3ec9c2990b
commit
c7e0697e9c
|
@ -38,35 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
|
|||
|
||||
#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
|
||||
*
|
||||
|
@ -158,10 +129,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
|
|||
case WM_NCMOUSELEAVE:
|
||||
return NC_HandleNCMouseLeave( hwnd );
|
||||
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
DEFWND_HandleWindowPosChanged( hwnd, (const WINDOWPOS *)lParam );
|
||||
break;
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
{
|
||||
POINT pt;
|
||||
|
|
|
@ -489,6 +489,29 @@ static LONG handle_window_pos_changing( HWND hwnd, WINDOWPOS *winpos )
|
|||
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
|
||||
*
|
||||
|
@ -2324,6 +2347,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
|
|||
case WM_WINDOWPOSCHANGING:
|
||||
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_PAINT:
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue