user32: Default to the dummy surface if the driver doesn't provide something else.

This commit is contained in:
Alexandre Julliard 2012-10-01 13:09:27 +02:00
parent 72337011db
commit 91b0ee56cf
2 changed files with 12 additions and 1 deletions

View File

@ -1949,11 +1949,17 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects )
{
WND *win;
HWND parent = GetAncestor( hwnd, GA_PARENT );
BOOL ret;
int old_width;
RECT visible_rect, old_visible_rect, old_window_rect;
struct window_surface *old_surface, *new_surface = NULL;
if (!parent || parent == GetDesktopWindow())
{
new_surface = &dummy_surface; /* provide a default surface for top-level windows */
window_surface_add_ref( new_surface );
}
visible_rect = *window_rect;
USER_Driver->pWindowPosChanging( hwnd, insert_after, swp_flags,
window_rect, client_rect, &visible_rect, &new_surface );

View File

@ -2030,9 +2030,14 @@ void CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flag
X11DRV_window_to_X_rect( data, visible_rect );
/* create the window surface if necessary */
if (!data->whole_window) goto done;
if (data->embedded) goto done;
if (swp_flags & SWP_HIDEWINDOW) goto done;
if (*surface) window_surface_release( *surface );
*surface = NULL; /* indicate that we want to draw directly to the window */
if (data->embedded) goto done;
if (data->whole_window == root_window) goto done;
if (has_gl_drawable( hwnd )) goto done;
if (!client_side_graphics && !layered) goto done;