From 91b0ee56cf3e6a16fa0cc82df642a77b204ea145 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 1 Oct 2012 13:09:27 +0200 Subject: [PATCH] user32: Default to the dummy surface if the driver doesn't provide something else. --- dlls/user32/winpos.c | 6 ++++++ dlls/winex11.drv/window.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index fa74567a5c4..0593140bbf7 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -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 ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a2103da852f..dff43845d31 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -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; -- 2.11.4.GIT