Alexandre Julliard : user32: Add a Wine-specific entry point to set the pixel format of a window.
Alexandre Julliard
julliard at winehq.org
Thu Oct 4 13:38:36 CDT 2012
Module: wine
Branch: master
Commit: e41a4828900d513359b4a323d43bea4e60b43885
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e41a4828900d513359b4a323d43bea4e60b43885
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Oct 3 23:01:43 2012 +0200
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(+), 0 deletions(-)
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index d5c123c..231d3b1 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 0f487f7..ee5fac9 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 b8c55c2..b19f334 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 a9385e6..74ad0f2 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 */
More information about the wine-cvs
mailing list