user32: Factor IsRectEmpty driver check in ShowWindow.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-05-14 13:40:04 +02:00 committed by Alexandre Julliard
parent c5ed4893b3
commit 07b9f3f609
4 changed files with 4 additions and 5 deletions

View File

@ -1044,7 +1044,7 @@ static BOOL show_window( HWND hwnd, INT cmd )
BOOL wasVisible = (style & WS_VISIBLE) != 0;
BOOL showFlag = TRUE;
RECT newPos = {0, 0, 0, 0};
UINT swp = 0;
UINT new_swp, swp = 0;
TRACE("hwnd=%p, cmd=%d, wasVisible %d\n", hwnd, cmd, wasVisible);
@ -1117,7 +1117,9 @@ static BOOL show_window( HWND hwnd, INT cmd )
if (!IsWindow( hwnd )) goto done;
}
swp = USER_Driver->pShowWindow( hwnd, cmd, &newPos, swp );
if (IsRectEmpty( &newPos )) new_swp = swp;
else new_swp = USER_Driver->pShowWindow( hwnd, cmd, &newPos, swp );
swp = new_swp;
parent = GetAncestor( hwnd, GA_PARENT );
if (parent && !IsWindowVisible( parent ) && !(swp & SWP_STATECHANGED))

View File

@ -1385,7 +1385,6 @@ void CDECL ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flag
*/
UINT CDECL ANDROID_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
{
if (IsRectEmpty( rect )) return swp;
if (!IsIconic( hwnd )) return swp;
/* always hide icons off-screen */
if (rect->left != -32000 || rect->top != -32000)

View File

@ -1798,7 +1798,6 @@ UINT CDECL macdrv_ShowWindow(HWND hwnd, INT cmd, RECT *rect, UINT swp)
hwnd, data ? data->cocoa_window : NULL, cmd, wine_dbgstr_rect(rect), swp);
if (!data || !data->cocoa_window) goto done;
if (IsRectEmpty(rect)) goto done;
if (GetWindowLongW(hwnd, GWL_STYLE) & WS_MINIMIZE)
{
if (rect->left != -32000 || rect->top != -32000)

View File

@ -2560,7 +2560,6 @@ UINT CDECL X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
struct x11drv_win_data *data = get_win_data( hwnd );
if (!data || !data->whole_window) goto done;
if (IsRectEmpty( rect )) goto done;
if (style & WS_MINIMIZE)
{
if (((rect->left != -32000 || rect->top != -32000)) && hide_icon( data ))