winemac: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.

This commit is contained in:
Zebediah Figura 2023-01-20 18:09:03 -06:00 committed by Alexandre Julliard
parent 46c8a63752
commit f605add4fd

View file

@ -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,18 +1540,21 @@ static BOOL set_pixel_format(HDC hdc, int fmt, BOOL allow_reset)
return FALSE;
}
if (!internal)
{
/* cannot change it if already set */
int prev = win32u_get_window_pixel_format( hwnd );
if (prev)
return prev == fmt;
}
if (!(data = get_win_data(hwnd)))
{
FIXME("DC for window %p of other process: not implemented\n", hwnd);
return FALSE;
}
if (!allow_reset && data->pixel_format) /* cannot change it if already set */
{
ret = (data->pixel_format == fmt);
goto done;
}
/* Check if fmt is in our list of supported formats to see if it is supported. */
pf = get_pixel_format(fmt, FALSE /* non-displayable */);
if (!pf)
@ -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;
}