From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/vulkan.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index cf5c44012c8..df6882271b4 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -37,6 +37,7 @@
#include "wine/debug.h" #include "x11drv.h" +#include "xcomposite.h"
#define VK_NO_PROTOTYPES #define WINE_VK_HOST @@ -74,13 +75,6 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk
TRACE( "%p %p %p %p\n", hwnd, instance, surface, private );
- /* TODO: support child window rendering. */ - if (NtUserGetAncestor( hwnd, GA_PARENT ) != NtUserGetDesktopWindow()) - { - FIXME("Application requires child window rendering, which is not implemented yet!\n"); - return VK_ERROR_INCOMPATIBLE_DRIVER; - } - if (!(info.window = create_client_window( hwnd, &default_visual, default_colormap ))) { ERR("Failed to allocate client window for hwnd=%p\n", hwnd); @@ -118,6 +112,9 @@ static void X11DRV_vulkan_surface_attach( HWND hwnd, void *private )
if ((data = get_win_data( hwnd ))) { +#ifdef SONAME_LIBXCOMPOSITE + if (usexcomposite) pXCompositeUnredirectWindow( gdi_display, client_window, CompositeRedirectManual ); +#endif attach_client_window( data, client_window ); release_win_data( data ); } @@ -125,6 +122,8 @@ static void X11DRV_vulkan_surface_attach( HWND hwnd, void *private )
static void X11DRV_vulkan_surface_detach( HWND hwnd, void *private, HDC *hdc ) { + static const WCHAR displayW[] = {'D','I','S','P','L','A','Y'}; + UNICODE_STRING device_str = RTL_CONSTANT_STRING(displayW); Window client_window = (Window)private; struct x11drv_win_data *data;
@@ -135,6 +134,19 @@ static void X11DRV_vulkan_surface_detach( HWND hwnd, void *private, HDC *hdc ) detach_client_window( data, client_window ); release_win_data( data ); } + + if (hdc && (*hdc = NtGdiOpenDCW( &device_str, NULL, NULL, 0, TRUE, NULL, NULL, NULL ))) + { + struct x11drv_escape_set_drawable escape = {0}; + escape.code = X11DRV_SET_DRAWABLE; + escape.mode = IncludeInferiors; + escape.drawable = client_window; + NtUserGetClientRect( hwnd, &escape.dc_rect ); + NtGdiExtEscape( *hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); +#ifdef SONAME_LIBXCOMPOSITE + if (usexcomposite) pXCompositeRedirectWindow( gdi_display, client_window, CompositeRedirectManual ); +#endif + } }
static void X11DRV_vulkan_surface_presented(HWND hwnd, VkResult result)