[PATCH 0/3] MR9652: winex11: Allow client window creation on other process windows.
This should fix Steam not rendering anymore on NVIDIA / XWayland. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9652
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/win32u/opengl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 57a0c773cbc..8fdc7deaf2f 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -1656,7 +1656,7 @@ static BOOL context_sync_drawables( struct wgl_context *context, HDC draw_hdc, H if (draw_hdc && !context->draw) context->draw = get_dc_opengl_drawable( draw_hdc ); if (read_hdc && !context->read) context->read = get_dc_opengl_drawable( read_hdc ); - new_draw = get_updated_drawable( draw_hdc, context->format, context->draw ); + if (!(new_draw = get_updated_drawable( draw_hdc, context->format, context->draw ))) return FALSE; if (!draw_hdc && context->draw == context->read) opengl_drawable_add_ref( (new_read = new_draw) ); else if (draw_hdc && draw_hdc == read_hdc) opengl_drawable_add_ref( (new_read = new_draw) ); else new_read = get_updated_drawable( read_hdc, context->format, context->read ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9652
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/win32u/opengl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 8fdc7deaf2f..70744889d02 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -1631,17 +1631,21 @@ static struct opengl_drawable *get_updated_drawable( HDC hdc, int format, struct { HWND hwnd = NULL; + /* return the memory DCs drawables directly */ if (hdc && !(hwnd = NtUserWindowFromDC( hdc ))) return get_dc_opengl_drawable( hdc ); if (!hdc && drawable && drawable->client) hwnd = drawable->client->hwnd; if (!hwnd) return NULL; - /* if the window still has a drawable, keep using the one we have */ + /* if the drawable we were using is for the same window, keep using it */ if (drawable && is_client_surface_window( drawable->client, hwnd )) { opengl_drawable_add_ref( drawable ); return drawable; } + /* retrieve D3D internal drawables from the DCs if they have any */ + if (hdc && (drawable = get_dc_opengl_drawable( hdc ))) return drawable; + /* get an updated drawable with the desired format */ return get_window_unused_drawable( hwnd, format ); } @@ -1652,10 +1656,6 @@ static BOOL context_sync_drawables( struct wgl_context *context, HDC draw_hdc, H struct wgl_context *previous = NtCurrentTeb()->glContext; BOOL ret = FALSE; - /* retrieve the D3D internal drawables from the DCs if they have any */ - if (draw_hdc && !context->draw) context->draw = get_dc_opengl_drawable( draw_hdc ); - if (read_hdc && !context->read) context->read = get_dc_opengl_drawable( read_hdc ); - if (!(new_draw = get_updated_drawable( draw_hdc, context->format, context->draw ))) return FALSE; if (!draw_hdc && context->draw == context->read) opengl_drawable_add_ref( (new_read = new_draw) ); else if (draw_hdc && draw_hdc == read_hdc) opengl_drawable_add_ref( (new_read = new_draw) ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9652
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/winex11.drv/window.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 92a96fd70cc..13434a93d31 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2345,9 +2345,7 @@ Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *vis if (!data) { - /* explicitly create data for HWND_MESSAGE windows since they can be used for OpenGL */ - HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); - if (parent == NtUserGetDesktopWindow() || NtUserGetAncestor( parent, GA_PARENT )) return 0; + /* explicitly create data for HWND_MESSAGE and foreign windows since they can be used for OpenGL */ if (!(data = alloc_win_data( thread_init_display(), hwnd ))) return 0; data->rects.window = data->rects.visible = data->rects.client = client_rect; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9652
participants (1)
-
Rémi Bernon