From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/bitblt.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 780b565b744..04040e17c73 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1991,36 +1991,29 @@ 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 (!(data = get_win_data( hwnd ))) return TRUE; /* use default surface */ + if ((previous = *surface) && previous->funcs == &x11drv_surface_funcs) return TRUE;
- if (*surface) window_surface_release( *surface ); - *surface = NULL; /* indicate that we want to draw directly to the window */ + if ((data = get_win_data( hwnd ))) + { + *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->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 ); + release_win_data( data ); }
- *surface = create_surface( data->hwnd, data->whole_window, &data->vis, surface_rect, FALSE ); - done: - release_win_data( data ); + if (previous) window_surface_release( previous ); return TRUE; }