Alexandre Julliard : user32: Default to the dummy surface if the driver doesn't provide something else.
Alexandre Julliard
julliard at winehq.org
Mon Oct 1 13:35:06 CDT 2012
Module: wine
Branch: master
Commit: 91b0ee56cf3e6a16fa0cc82df642a77b204ea145
URL: http://source.winehq.org/git/wine.git/?a=commit;h=91b0ee56cf3e6a16fa0cc82df642a77b204ea145
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 1 13:09:27 2012 +0200
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 deletions(-)
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index fa74567..0593140 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 a2103da..dff4384 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;
More information about the wine-cvs
mailing list