[PATCH 1/2] wined3d: Only use default SetPixelFormat on private windows.

Connor McAdams cmcadams at codeweavers.com
Fri Apr 16 15:01:25 CDT 2021


Only use the default SetPixelFormat function if the format is unset and
the window is private. If the window isn't private, use
wglSetPixelFormatWINE, which allows for another application to change
the pixel format.

Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>
---
I'm not sure if this is the correct way to do this, so you'll have to
let me know if there's a better way. Currently, the application I'm
trying to get work sets the pixel format after wined3d's initial format
set. So, in this case, I'm assuming it'd make sense to only use the
default SetPixelFormat if we know the window is private to wined3d.
---
 dlls/wined3d/context_gl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 123214afd5d..bbed7f46875 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -1196,7 +1196,7 @@ static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *conte
     current = gl_info->gl_ops.wgl.p_wglGetPixelFormat(dc);
     if (current == format) goto success;
 
-    if (!current)
+    if (!current && private)
     {
         if (!SetPixelFormat(dc, format, NULL))
         {
-- 
2.25.1




More information about the wine-devel mailing list