From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/opengl.c | 4 ++-- dlls/winex11.drv/vulkan.c | 2 +- dlls/winex11.drv/window.c | 24 +++++++++++------------- dlls/winex11.drv/x11drv.h | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index e68bdd59ddb..5cacb1d9649 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1121,7 +1121,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, (visual->class == PseudoColor || visual->class == GrayScale || visual->class == DirectColor) ? AllocAll : AllocNone ); - gl->window = create_client_window( hwnd, visual, gl->colormap ); + gl->window = create_client_window( hwnd, visual, gl->colormap, FALSE ); if (gl->window) gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); TRACE( "%p created client %lx drawable %lx\n", hwnd, gl->window, gl->drawable ); @@ -1133,7 +1133,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel gl->colormap = XCreateColormap( gdi_display, get_dummy_parent(), visual->visual, (visual->class == PseudoColor || visual->class == GrayScale || visual->class == DirectColor) ? AllocAll : AllocNone ); - gl->window = create_client_window( hwnd, visual, gl->colormap ); + gl->window = create_client_window( hwnd, visual, gl->colormap, TRUE ); if (gl->window) { gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL ); diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 85993bc517a..99409f988c8 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -81,7 +81,7 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk return VK_ERROR_INCOMPATIBLE_DRIVER; }
- if (!(info.window = create_client_window( hwnd, &default_visual, default_colormap ))) + if (!(info.window = create_client_window( hwnd, &default_visual, default_colormap, FALSE ))) { ERR("Failed to allocate client window for hwnd=%p\n", hwnd); return VK_ERROR_OUT_OF_HOST_MEMORY; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 1902d060bba..de4e93b54ee 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1596,12 +1596,12 @@ void destroy_client_window( HWND hwnd, Window client_window ) /********************************************************************** * create_client_window */ -Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ) +Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap, BOOL offscreen ) { Window dummy_parent = get_dummy_parent(); struct x11drv_win_data *data = get_win_data( hwnd ); XSetWindowAttributes attr; - Window ret; + Window client_window, parent_window; int x, y, cx, cy;
if (!data) @@ -1614,7 +1614,7 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo data->rects.window = data->rects.visible = data->rects.client; }
- detach_client_window( data, data->client_window ); + if (!offscreen) detach_client_window( data, data->client_window );
attr.colormap = colormap; attr.bit_gravity = NorthWestGravity; @@ -1628,23 +1628,21 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo cy = min( max( 1, data->rects.client.bottom - data->rects.client.top ), 65535 );
XSync( gdi_display, False ); /* make sure whole_window is known from gdi_display */ - ret = data->client_window = XCreateWindow( gdi_display, - data->whole_window ? data->whole_window : dummy_parent, - x, y, cx, cy, 0, default_visual.depth, InputOutput, - visual->visual, CWBitGravity | CWWinGravity | - CWBackingStore | CWColormap | CWBorderPixel, &attr ); - if (data->client_window) - { - XMapWindow( gdi_display, data->client_window ); - if (data->whole_window) + if (offscreen || !(parent_window = data->whole_window)) parent_window = dummy_parent; + if ((client_window = XCreateWindow( gdi_display, parent_window, x, y, cx, cy, 0, default_visual.depth, InputOutput, visual->visual, + CWBitGravity | CWWinGravity | CWBackingStore | CWColormap | CWBorderPixel, &attr ))) + { + XMapWindow( gdi_display, client_window ); + if (!offscreen) { + data->client_window = client_window; XFlush( gdi_display ); /* make sure client_window is created for XSelectInput */ client_window_events_enable( data, data->client_window ); } TRACE( "%p xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window ); } release_win_data( data ); - return ret; + return client_window; }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index e904087f262..88560a9c9e0 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -642,7 +642,7 @@ extern void update_user_time( Time time ); extern void read_net_wm_states( Display *display, struct x11drv_win_data *data ); extern void update_net_wm_states( struct x11drv_win_data *data ); extern void make_window_embedded( struct x11drv_win_data *data ); -extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); +extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap, BOOL offscreen ); extern void detach_client_window( struct x11drv_win_data *data, Window client_window ); extern void destroy_client_window( HWND hwnd, Window client_window ); extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha );