Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3255b214
Commit
3255b214
authored
Apr 11, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Allow OpenGL on minimized windows.
parent
a4fad541
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
6 deletions
+76
-6
opengl.c
dlls/opengl32/tests/opengl.c
+70
-0
window.c
dlls/winex11.drv/window.c
+6
-6
No files found.
dlls/opengl32/tests/opengl.c
View file @
3255b214
...
@@ -650,6 +650,75 @@ static void test_opengl3(HDC hdc)
...
@@ -650,6 +650,75 @@ static void test_opengl3(HDC hdc)
}
}
}
}
static
void
test_minimized
(
void
)
{
PIXELFORMATDESCRIPTOR
pf_desc
=
{
sizeof
(
PIXELFORMATDESCRIPTOR
),
1
,
/* version */
PFD_DRAW_TO_WINDOW
|
PFD_SUPPORT_OPENGL
|
PFD_DOUBLEBUFFER
,
PFD_TYPE_RGBA
,
24
,
/* 24-bit color depth */
0
,
0
,
0
,
0
,
0
,
0
,
/* color bits */
0
,
/* alpha buffer */
0
,
/* shift bit */
0
,
/* accumulation buffer */
0
,
0
,
0
,
0
,
/* accum bits */
32
,
/* z-buffer */
0
,
/* stencil buffer */
0
,
/* auxiliary buffer */
PFD_MAIN_PLANE
,
/* main layer */
0
,
/* reserved */
0
,
0
,
0
/* layer masks */
};
int
pixel_format
;
HWND
window
;
LONG
style
;
HGLRC
ctx
;
BOOL
ret
;
HDC
dc
;
window
=
CreateWindowA
(
"static"
,
"opengl32_test"
,
WS_POPUP
|
WS_MINIMIZE
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ok
(
!!
window
,
"Failed to create window, last error %#x.
\n
"
,
GetLastError
());
dc
=
GetDC
(
window
);
ok
(
!!
dc
,
"Failed to get DC.
\n
"
);
pixel_format
=
ChoosePixelFormat
(
dc
,
&
pf_desc
);
if
(
!
pixel_format
)
{
win_skip
(
"Failed to find pixel format.
\n
"
);
ReleaseDC
(
window
,
dc
);
DestroyWindow
(
window
);
return
;
}
ret
=
SetPixelFormat
(
dc
,
pixel_format
,
&
pf_desc
);
ok
(
ret
,
"Failed to set pixel format, last error %#x.
\n
"
,
GetLastError
());
style
=
GetWindowLongA
(
window
,
GWL_STYLE
);
ok
(
style
&
WS_MINIMIZE
,
"Window should be minimized, got style %#x.
\n
"
,
style
);
ctx
=
wglCreateContext
(
dc
);
ok
(
!!
ctx
,
"Failed to create GL context, last error %#x.
\n
"
,
GetLastError
());
ret
=
wglMakeCurrent
(
dc
,
ctx
);
ok
(
ret
,
"Failed to make context current, last error %#x.
\n
"
,
GetLastError
());
style
=
GetWindowLongA
(
window
,
GWL_STYLE
);
ok
(
style
&
WS_MINIMIZE
,
"window should be minimized, got style %#x.
\n
"
,
style
);
ret
=
wglMakeCurrent
(
NULL
,
NULL
);
ok
(
ret
,
"Failed to clear current context, last error %#x.
\n
"
,
GetLastError
());
ret
=
wglDeleteContext
(
ctx
);
ok
(
ret
,
"Failed to delete GL context, last error %#x.
\n
"
,
GetLastError
());
ReleaseDC
(
window
,
dc
);
DestroyWindow
(
window
);
}
START_TEST
(
opengl
)
START_TEST
(
opengl
)
{
{
HWND
hwnd
;
HWND
hwnd
;
...
@@ -704,6 +773,7 @@ START_TEST(opengl)
...
@@ -704,6 +773,7 @@ START_TEST(opengl)
res
=
SetPixelFormat
(
hdc
,
iPixelFormat
,
&
pfd
);
res
=
SetPixelFormat
(
hdc
,
iPixelFormat
,
&
pfd
);
ok
(
res
,
"SetPixelformat failed: %x
\n
"
,
GetLastError
());
ok
(
res
,
"SetPixelformat failed: %x
\n
"
,
GetLastError
());
test_minimized
();
test_dc
(
hwnd
,
hdc
);
test_dc
(
hwnd
,
hdc
);
hglrc
=
wglCreateContext
(
hdc
);
hglrc
=
wglCreateContext
(
hdc
);
...
...
dlls/winex11.drv/window.c
View file @
3255b214
...
@@ -1951,16 +1951,16 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
...
@@ -1951,16 +1951,16 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
escape
.
pixmap
=
0
;
escape
.
pixmap
=
0
;
escape
.
gl_copy
=
FALSE
;
escape
.
gl_copy
=
FALSE
;
if
(
top
==
hwnd
&&
data
&&
IsIconic
(
hwnd
)
&&
data
->
icon_window
)
if
(
top
==
hwnd
)
{
escape
.
drawable
=
data
->
icon_window
;
}
else
if
(
top
==
hwnd
)
{
{
escape
.
fbconfig_id
=
data
?
data
->
fbconfig_id
:
(
XID
)
GetPropA
(
hwnd
,
fbconfig_id_prop
);
escape
.
fbconfig_id
=
data
?
data
->
fbconfig_id
:
(
XID
)
GetPropA
(
hwnd
,
fbconfig_id_prop
);
/* GL draws to the client area even for window DCs */
/* GL draws to the client area even for window DCs */
escape
.
gl_drawable
=
data
?
data
->
client_window
:
X11DRV_get_client_window
(
hwnd
);
escape
.
gl_drawable
=
data
?
data
->
client_window
:
X11DRV_get_client_window
(
hwnd
);
if
(
flags
&
DCX_WINDOW
)
if
(
data
&&
IsIconic
(
hwnd
)
&&
data
->
icon_window
)
{
escape
.
drawable
=
data
->
icon_window
;
}
else
if
(
flags
&
DCX_WINDOW
)
escape
.
drawable
=
data
?
data
->
whole_window
:
X11DRV_get_whole_window
(
hwnd
);
escape
.
drawable
=
data
?
data
->
whole_window
:
X11DRV_get_whole_window
(
hwnd
);
else
else
escape
.
drawable
=
escape
.
gl_drawable
;
escape
.
drawable
=
escape
.
gl_drawable
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment