Module: wine Branch: master Commit: f605add4fde2d94f029145573b72ee87fdc65bea URL: https://gitlab.winehq.org/wine/wine/-/commit/f605add4fde2d94f029145573b72ee8...
Author: Zebediah Figura zfigura@codeweavers.com Date: Fri Jan 20 18:09:03 2023 -0600
winemac: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
---
dlls/winemac.drv/opengl.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index 6f3c3b88155..55e5704724b 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -1525,7 +1525,7 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns * * Implementation of wglSetPixelFormat and wglSetPixelFormatWINE. */ -static BOOL set_pixel_format(HDC hdc, int fmt, BOOL allow_reset) +static BOOL set_pixel_format(HDC hdc, int fmt, BOOL internal) { struct macdrv_win_data *data; const pixel_format *pf; @@ -1540,16 +1540,19 @@ static BOOL set_pixel_format(HDC hdc, int fmt, BOOL allow_reset) return FALSE; }
- if (!(data = get_win_data(hwnd))) + if (!internal) { - FIXME("DC for window %p of other process: not implemented\n", hwnd); - return FALSE; + /* cannot change it if already set */ + int prev = win32u_get_window_pixel_format( hwnd ); + + if (prev) + return prev == fmt; }
- if (!allow_reset && data->pixel_format) /* cannot change it if already set */ + if (!(data = get_win_data(hwnd))) { - ret = (data->pixel_format == fmt); - goto done; + FIXME("DC for window %p of other process: not implemented\n", hwnd); + return FALSE; }
/* Check if fmt is in our list of supported formats to see if it is supported. */ @@ -1588,7 +1591,7 @@ static BOOL set_pixel_format(HDC hdc, int fmt, BOOL allow_reset) done: release_win_data(data); if (ret && gl_surface_mode == GL_SURFACE_BEHIND) - win32u_set_window_pixel_format(hwnd, fmt, FALSE); + win32u_set_window_pixel_format(hwnd, fmt, internal); return ret; }