And avoid triggering X11 errors with foreign windows.
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56622 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57003 --- dlls/winex11.drv/bitblt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 1a584ff7fb6..7a3785ae398 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1993,8 +1993,13 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_re
TRACE( "hwnd %p, layered %u, surface_rect %s, surface %p\n", hwnd, layered, 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 = *surface) && previous->funcs == &x11drv_surface_funcs) + { + if (data->whole_window == get_x11_surface(previous)->window) goto done; /* use default surface */ + /* re-create window surface is window has changed, which can happen when changing visual */ + TRACE( "re-creating hwnd %p surface with new window %lx\n", data->hwnd, data->whole_window ); + } if (previous) window_surface_release( previous );
if (layered)
From: Rémi Bernon rbernon@codeweavers.com
It was previously passing layered = FALSE unless called directly from NtUserUpdateLayeredWindow.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56622 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57003 --- dlls/win32u/window.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 11336b01309..c7b1190230b 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1869,6 +1869,7 @@ static struct window_surface *create_window_surface( HWND hwnd, UINT swp_flags, new_surface = &dummy_surface; window_surface_add_ref( new_surface ); } + else if (!create_opaque && is_layered) create_layered = TRUE;
if (create_layered || is_layered) needs_surface = TRUE; if (!needs_surface || IsRectEmpty( visible_rect )) needs_surface = FALSE; /* use default surface */
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56622 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57003 --- dlls/winex11.drv/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 98cb7952164..aa4f43f1cc3 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1410,8 +1410,8 @@ static void sync_window_position( struct x11drv_win_data *data, mask |= CWWidth | CWHeight; }
- /* only the size is allowed to change for the desktop window */ - if (data->whole_window != root_window) + /* only the size is allowed to change for the desktop window or systray docked windows */ + if (data->whole_window != root_window && !data->embedded) { POINT pt = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); changes.x = pt.x;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/bitblt.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 7a3785ae398..7c5d0643570 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1994,6 +1994,7 @@ BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_re TRACE( "hwnd %p, layered %u, surface_rect %s, surface %p\n", hwnd, layered, wine_dbgstr_rect( surface_rect ), surface );
if (!(data = get_win_data( hwnd ))) return TRUE; /* use default surface */ + if (!data->whole_window) goto done; /* use the dummy/offscreen surfaces for foreign windows */ if ((previous = *surface) && previous->funcs == &x11drv_surface_funcs) { if (data->whole_window == get_x11_surface(previous)->window) goto done; /* use default surface */
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index aa4f43f1cc3..61b57ebd56b 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2458,6 +2458,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, else escape.drawable = X11DRV_get_whole_window( top ); }
+ if (!escape.drawable) return; /* don't create a GC for foreign windows */ NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); }