From e41a4828900d513359b4a323d43bea4e60b43885 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 3 Oct 2012 23:01:43 +0200 Subject: [PATCH] user32: Add a Wine-specific entry point to set the pixel format of a window. --- dlls/user32/user32.spec | 1 + dlls/user32/win.c | 15 +++++++++++++++ dlls/winex11.drv/opengl.c | 2 ++ include/wine/wgl_driver.h | 1 + 4 files changed, 19 insertions(+) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index d5c123ca5fa..231d3b1205d 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -779,3 +779,4 @@ # or 'wine_' (for user-visible functions) to avoid namespace conflicts. # @ cdecl __wine_send_input(long ptr) +@ cdecl __wine_set_pixel_format(long long) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 0f487f7c34a..ee5fac92b8c 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -3592,6 +3592,21 @@ BOOL WINAPI SwitchDesktop( HDESK hDesktop) return TRUE; } + +/*********************************************************************** + * __wine_set_pixel_format + */ +BOOL CDECL __wine_set_pixel_format( HWND hwnd, int format ) +{ + RECT window_rect, client_rect; + + WIN_GetRectangles( hwnd, COORDS_PARENT, &window_rect, &client_rect ); + return set_window_pos( hwnd, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | + SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW, + &window_rect, &client_rect, NULL ); +} + + /***************************************************************************** * SetLayeredWindowAttributes (USER32.@) */ diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index b8c55c25cac..b19f334b50e 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1286,6 +1286,8 @@ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format ) free_gl_drawable( prev ); XSaveContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char *)gl ); LeaveCriticalSection( &context_section ); + + __wine_set_pixel_format( hwnd, pixel_format_index( format )); return TRUE; } diff --git a/include/wine/wgl_driver.h b/include/wine/wgl_driver.h index a9385e6030f..74ad0f2f96e 100644 --- a/include/wine/wgl_driver.h +++ b/include/wine/wgl_driver.h @@ -2853,5 +2853,6 @@ struct opengl_funcs USE_GL_FUNC(glViewport) extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version ); +extern BOOL CDECL __wine_set_pixel_format( HWND hwnd, int format ); #endif /* __WINE_WGL_DRIVER_H */ -- 2.11.4.GIT