Zebediah Figura : winemac: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
Module: wine Branch: master Commit: 15f03ac3cbf71d4269f5d88d53787776b115abd3 URL: https://gitlab.winehq.org/wine/wine/-/commit/15f03ac3cbf71d4269f5d88d5378777... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 20 14:23:15 2023 -0600 winemac: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat(). --- dlls/winemac.drv/opengl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index 7251745258a..d92276bf253 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -1329,12 +1329,11 @@ static BOOL init_gl_info(void) } -static int get_dc_pixel_format(HDC hdc) +static int get_dc_pixel_format(HWND hwnd, HDC hdc) { int format; - HWND hwnd; - if ((hwnd = NtUserWindowFromDC(hdc))) + if (hwnd) { struct macdrv_win_data *data; @@ -2719,7 +2718,7 @@ static struct wgl_context *macdrv_wglCreateContextAttribsARB(HDC hdc, TRACE("hdc %p, share_context %p, attrib_list %p\n", hdc, share_context, attrib_list); - format = get_dc_pixel_format(hdc); + format = get_dc_pixel_format(NtUserWindowFromDC(hdc), hdc); if (!is_valid_pixel_format(format)) { @@ -4417,8 +4416,12 @@ static BOOL macdrv_wglDeleteContext(struct wgl_context *context) static int macdrv_wglGetPixelFormat(HDC hdc) { int format; + HWND hwnd; + + if ((hwnd = NtUserWindowFromDC( hdc ))) + return win32u_get_window_pixel_format( hwnd ); - format = get_dc_pixel_format(hdc); + format = get_dc_pixel_format(NULL, hdc); if (!is_valid_pixel_format(format)) /* not set yet */ format = 0;
participants (1)
-
Alexandre Julliard