From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/wineandroid.drv/window.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 553ed985fae..0d6df89d06f 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1067,28 +1067,17 @@ done: */ BOOL ANDROID_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct window_surface **surface ) { + struct window_surface *previous; struct android_win_data *data; TRACE( "hwnd %p, surface_rect %s, surface %p\n", hwnd, wine_dbgstr_rect( surface_rect ), surface ); + if ((previous = *surface) && previous->funcs == &android_surface_funcs) return TRUE; if (!(data = get_win_data( hwnd ))) return TRUE; /* use default surface */ + if (previous) window_surface_release( previous ); - if (data->surface) - { - if (EqualRect( &data->surface->rect, surface_rect )) - { - /* existing surface is good enough */ - window_surface_add_ref( data->surface ); - if (*surface) window_surface_release( *surface ); - *surface = data->surface; - goto done; - } - } - - if (*surface) window_surface_release( *surface ); *surface = create_surface( data->hwnd, surface_rect ); -done: release_win_data( data ); return TRUE; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6081