[PATCH v8 1/2] user32: Retrieve the work rect for placements in a helper function.

Huw Davies huw at codeweavers.com
Wed Sep 1 02:33:22 CDT 2021


On Tue, Aug 31, 2021 at 04:42:28PM +0300, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
>  dlls/user32/winpos.c | 45 ++++++++++++++++++++++++++++----------------
>  1 file changed, 29 insertions(+), 16 deletions(-)
> 
> diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
> index 6e96a4b..33a7de5 100644
> --- a/dlls/user32/winpos.c
> +++ b/dlls/user32/winpos.c
> @@ -675,6 +675,33 @@ BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
>  }
>  
>  
> +/*******************************************************************
> + *           get_work_rect
> + *
> + * Get the work area that a maximized window can cover, depending on style.
> + */
> +static BOOL get_work_rect( HWND hwnd, RECT *rect )
> +{
> +    HMONITOR monitor = MonitorFromWindow( hwnd, MONITOR_DEFAULTTOPRIMARY );
> +    MONITORINFO mon_info;
> +    DWORD style;
> +
> +    if (!monitor) return FALSE;
> +
> +    mon_info.cbSize = sizeof(mon_info);
> +    GetMonitorInfoW( monitor, &mon_info );
> +
> +    style = GetWindowLongW( hwnd, GWL_STYLE );
> +    *rect = mon_info.rcMonitor;

I've sent in v9 which swaps the order of the two statements above and provides
a clearer commit msg.

> +    if (style & WS_MAXIMIZEBOX)
> +    {

Huw.



More information about the wine-devel mailing list