win32u: Allow separately storing the internal pixel format set by WGL_WINE_pixel_format_passthrough.

This commit is contained in:
Zebediah Figura 2023-01-20 16:17:44 -06:00 committed by Alexandre Julliard
parent 8da023fe8c
commit c2018ff466
6 changed files with 14 additions and 8 deletions

View file

@ -90,6 +90,7 @@ typedef struct tagWND
struct window_surface *surface; /* Window surface if any */
struct tagDIALOGINFO *dlgInfo; /* Dialog additional info (dialogs only) */
int pixel_format; /* Pixel format set by the graphics driver */
int internal_pixel_format; /* Internal pixel format set via WGL_WINE_pixel_format_passthrough */
int cbWndExtra; /* class cbWndExtra at window creation */
DWORD_PTR userdata; /* User private data */
DWORD wExtra[1]; /* Window extra bytes */

View file

@ -1441,7 +1441,7 @@ LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval,
return set_window_long( hwnd, offset, sizeof(LONG_PTR), newval, ansi );
}
BOOL win32u_set_window_pixel_format( HWND hwnd, int format )
BOOL win32u_set_window_pixel_format( HWND hwnd, int format, BOOL internal )
{
WND *win = get_win_ptr( hwnd );
@ -1450,7 +1450,10 @@ BOOL win32u_set_window_pixel_format( HWND hwnd, int format )
WARN( "setting format %d on win %p not supported\n", format, hwnd );
return FALSE;
}
win->pixel_format = format;
if (internal)
win->internal_pixel_format = format;
else
win->pixel_format = format;
release_win_ptr( win );
update_window_state( hwnd );
@ -1852,7 +1855,8 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
wine_server_add_data( req, extra_rects, sizeof(extra_rects) );
}
if (new_surface) req->paint_flags |= SET_WINPOS_PAINT_SURFACE;
if (win->pixel_format) req->paint_flags |= SET_WINPOS_PIXEL_FORMAT;
if (win->pixel_format || win->internal_pixel_format)
req->paint_flags |= SET_WINPOS_PIXEL_FORMAT;
if ((ret = !wine_server_call( req )))
{

View file

@ -242,7 +242,7 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL allow_change )
release_gl_drawable( gl );
if (prev && prev != format && !allow_change) return FALSE;
if (win32u_set_window_pixel_format( hwnd, format )) return TRUE;
if (win32u_set_window_pixel_format( hwnd, format, FALSE )) return TRUE;
destroy_gl_drawable( hwnd );
return FALSE;
}

View file

@ -1587,7 +1587,8 @@ 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);
if (ret && gl_surface_mode == GL_SURFACE_BEHIND)
win32u_set_window_pixel_format(hwnd, fmt, FALSE);
return ret;
}

View file

@ -1402,7 +1402,7 @@ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format, BO
XFlush( gdi_display );
release_gl_drawable( gl );
win32u_set_window_pixel_format( hwnd, pixel_format_index( format ));
win32u_set_window_pixel_format( hwnd, pixel_format_index( format ), FALSE );
return TRUE;
}
@ -1512,7 +1512,7 @@ void set_gl_drawable_parent( HWND hwnd, HWND parent )
else
{
destroy_gl_drawable( hwnd );
win32u_set_window_pixel_format( hwnd, 0 );
win32u_set_window_pixel_format( hwnd, 0, FALSE );
}
release_gl_drawable( old );
}

View file

@ -339,7 +339,7 @@ struct user_driver_funcs
extern void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version );
extern BOOL win32u_set_window_pixel_format( HWND hwnd, int format );
extern BOOL win32u_set_window_pixel_format( HWND hwnd, int format, BOOL internal );
extern int win32u_get_window_pixel_format( HWND hwnd );
#endif /* WINE_UNIX_LIB */