From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/bitblt.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 780b565b744..4e4de2d3990 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1991,32 +1991,22 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) */ BOOL X11DRV_CreateWindowSurface( HWND hwnd, const RECT *surface_rect, struct window_surface **surface ) { + struct window_surface *previous; struct x11drv_win_data *data; BOOL layered = NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED;
TRACE( "hwnd %p, surface_rect %s, surface %p\n", hwnd, wine_dbgstr_rect( surface_rect ), surface );
+ if ((previous = *surface) && previous->funcs == &x11drv_surface_funcs) return TRUE; if (!(data = get_win_data( hwnd ))) return TRUE; /* use default surface */ + if (previous) window_surface_release( previous );
- if (*surface) window_surface_release( *surface ); *surface = NULL; /* indicate that we want to draw directly to the window */ - if (data->embedded) goto done; /* draw directly to the window */ if (data->whole_window == root_window) goto done; /* draw directly to the window */ if (data->client_window) goto done; /* draw directly to the window */ if (!client_side_graphics && !layered) goto done; /* draw directly to the window */
- if (data->surface) - { - if (EqualRect( &data->surface->rect, surface_rect )) - { - /* existing surface is good enough */ - window_surface_add_ref( data->surface ); - *surface = data->surface; - goto done; - } - } - *surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, FALSE );
done: