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

win32u: Move default WM_WINDOWPOSCHANGING implementation from user32.

parent 63ce060e
......@@ -180,9 +180,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
NC_HandleNCCalcSize( hwnd, wParam, (RECT *)lParam );
break;
case WM_WINDOWPOSCHANGING:
return WINPOS_HandleWindowPosChanging( hwnd, (WINDOWPOS *)lParam );
case WM_WINDOWPOSCHANGED:
DEFWND_HandleWindowPosChanged( hwnd, (const WINDOWPOS *)lParam );
break;
......
......@@ -60,7 +60,6 @@ static inline void WIN_ReleasePtr( WND *ptr )
extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN;
extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPEC_HIDDEN;
extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) DECLSPEC_HIDDEN;
......
......@@ -654,31 +654,6 @@ void WINPOS_ActivateOtherWindow(HWND hwnd)
/***********************************************************************
* WINPOS_HandleWindowPosChanging
*
* Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
*/
LONG WINPOS_HandleWindowPosChanging( HWND hwnd, WINDOWPOS *winpos )
{
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
if (winpos->flags & SWP_NOSIZE) return 0;
if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
{
MINMAXINFO info = NtUserGetMinMaxInfo( hwnd );
winpos->cx = min( winpos->cx, info.ptMaxTrackSize.x );
winpos->cy = min( winpos->cy, info.ptMaxTrackSize.y );
if (!(style & WS_MINIMIZE))
{
winpos->cx = max( winpos->cx, info.ptMinTrackSize.x );
winpos->cy = max( winpos->cy, info.ptMinTrackSize.y );
}
}
return 0;
}
/***********************************************************************
* BeginDeferWindowPos (USER32.@)
*/
HDWP WINAPI BeginDeferWindowPos( INT count )
......
......@@ -195,6 +195,25 @@ static HICON set_window_icon( HWND hwnd, WPARAM type, HICON icon )
return ret;
}
static LONG handle_window_pos_changing( HWND hwnd, WINDOWPOS *winpos )
{
LONG style = get_window_long( hwnd, GWL_STYLE );
if (winpos->flags & SWP_NOSIZE) return 0;
if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
{
MINMAXINFO info = get_min_max_info( hwnd );
winpos->cx = min( winpos->cx, info.ptMaxTrackSize.x );
winpos->cy = min( winpos->cy, info.ptMaxTrackSize.y );
if (!(style & WS_MINIMIZE))
{
winpos->cx = max( winpos->cx, info.ptMinTrackSize.x );
winpos->cy = max( winpos->cy, info.ptMinTrackSize.y );
}
}
return 0;
}
static LRESULT handle_sys_command( HWND hwnd, WPARAM wparam, LPARAM lparam )
{
if (!is_window_enabled( hwnd )) return 0;
......@@ -255,6 +274,9 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
break;
}
case WM_WINDOWPOSCHANGING:
return handle_window_pos_changing( hwnd, (WINDOWPOS *)lparam );
case WM_PAINTICON:
case WM_PAINT:
{
......
......@@ -434,6 +434,7 @@ extern HWND get_parent( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
extern DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL get_window_placement( HWND hwnd, WINDOWPLACEMENT *placement ) DECLSPEC_HIDDEN;
extern MINMAXINFO get_min_max_info( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND get_window_relative( HWND hwnd, UINT rel ) DECLSPEC_HIDDEN;
extern DWORD get_window_thread( HWND hwnd, DWORD *process ) DECLSPEC_HIDDEN;
extern HWND is_current_process_window( HWND hwnd ) DECLSPEC_HIDDEN;
......
......@@ -3657,7 +3657,7 @@ static void send_parent_notify( HWND hwnd, UINT msg )
*
* Get the minimized and maximized information for a window.
*/
static MINMAXINFO get_min_max_info( HWND hwnd )
MINMAXINFO get_min_max_info( HWND hwnd )
{
LONG style = get_window_long( hwnd, GWL_STYLE );
LONG exstyle = get_window_long( hwnd, GWL_EXSTYLE );
......
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