[2/2] winex11: Allow PixelFormat 1 to be set on root_window
Matijn Woudt
tijnema at gmail.com
Sun Nov 14 11:55:11 CST 2010
Allow PixelFormat 1 to be set on root_window
-------------- next part --------------
From 02f39ecd66e811c525c3f046727a3e7a0a869cfd Mon Sep 17 00:00:00 2001
From: Matijn Woudt <tijnema at gmail.com>
Date: Sun, 14 Nov 2010 18:44:23 +0100
Subject: [PATCH 2/2] Allow PixelFormat 1 to be set on root_window
---
dlls/opengl32/tests/opengl.c | 4 ++--
dlls/winex11.drv/opengl.c | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index 3f9746a..e7d7225 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -239,10 +239,10 @@ static void test_setpixelformat(HDC winhdc)
ok(pf == 0, "GetPixelFormat should have failed, got: %i\n", pf);
res = SetPixelFormat(hdc, 1, NULL);
- todo_wine ok(res == TRUE, "SetPixelFormat failed\n");
+ ok(res == TRUE, "SetPixelFormat failed\n");
pf = GetPixelFormat(hdc);
- todo_wine ok(pf == 1, "GetPixelFormat should have returned 1, got: %i\n", pf);
+ ok(pf == 1, "GetPixelFormat should have returned 1, got: %i\n", pf);
/* This should pass even on the main device context */
pf = ChoosePixelFormat(hdc, &pfd);
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 1191332..360bcc6 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1623,6 +1623,11 @@ static BOOL internal_SetPixelFormat(X11DRV_PDEVICE *physDev,
/* SetPixelFormat is not allowed on the X root_window e.g. GetDC(0) */
if(get_glxdrawable(physDev) == root_window)
{
+ /* Special case, PixelFormat 1 can be set to root_window */
+ if(iPixelFormat == 1) {
+ physDev->current_pf = iPixelFormat;
+ return TRUE;
+ }
ERR("Invalid operation on root_window\n");
return FALSE;
}
--
1.7.0.4
More information about the wine-patches
mailing list