gdkglcontext-win32-wgl.c: Always request alpha bits
authorChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 9 May 2023 10:10:34 +0000 (18:10 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 9 May 2023 10:15:23 +0000 (18:15 +0800)
...when we are using wglChoosePixelFormatARHB().  This ensures that we
hvae a HDC with a pixel format that will really support alpha bits, as
we did for the traditional ChoosePixelFormat().

Thanks to Patrick Zacharias for testing and pointing things out.

gdk/win32/gdkglcontext-win32-wgl.c

index 3721d7136e0eacfa953ceb2cda4f2cdd19dd322f..fdc8e50e6e5c994e8dbb5ae66b4a8a53339daa8d 100644 (file)
@@ -171,6 +171,9 @@ get_wgl_pfd (HDC                    hdc,
       pixelAttribs[i++] = WGL_COLOR_BITS_ARB;
       pixelAttribs[i++] = colorbits;
 
+      pixelAttribs[i++] = WGL_ALPHA_BITS_ARB;
+      pixelAttribs[i++] = 8;
+
       /* end of "Update PIXEL_ATTRIBUTES above if any groups are added here!" */
 
       pixelAttribs[i++] = 0; /* end of pixelAttribs */