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
7c90c1a0
Commit
7c90c1a0
authored
Apr 16, 2010
by
Johan Gill
Committed by
Alexandre Julliard
Apr 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Do not restore the display mode from inside SetCooperativeLevel.
parent
ebfedcea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
9 deletions
+40
-9
ddraw.c
dlls/ddraw/ddraw.c
+1
-4
ddrawmodes.c
dlls/ddraw/tests/ddrawmodes.c
+39
-5
No files found.
dlls/ddraw/ddraw.c
View file @
7c90c1a0
...
...
@@ -264,8 +264,8 @@ IDirectDrawImpl_AddRef(IDirectDraw7 *iface)
void
IDirectDrawImpl_Destroy
(
IDirectDrawImpl
*
This
)
{
/* Clear the cooplevel to restore window and display mode */
IDirectDraw7_SetCooperativeLevel
((
IDirectDraw7
*
)
This
,
NULL
,
DDSCL_NORMAL
);
IDirectDraw7_RestoreDisplayMode
((
IDirectDraw7
*
)
This
);
/* Destroy the device window if we created one */
if
(
This
->
devicewindow
!=
0
)
...
...
@@ -441,9 +441,6 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface,
/* Switching from fullscreen? */
if
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
{
/* Restore the display mode */
IDirectDraw7_RestoreDisplayMode
(
iface
);
This
->
cooperative_level
&=
~
DDSCL_FULLSCREEN
;
This
->
cooperative_level
&=
~
DDSCL_EXCLUSIVE
;
This
->
cooperative_level
&=
~
DDSCL_ALLOWMODEX
;
...
...
dlls/ddraw/tests/ddrawmodes.c
View file @
7c90c1a0
...
...
@@ -37,6 +37,8 @@ static HWND hwnd;
static
int
modes_cnt
;
static
int
modes_size
;
static
LPDDSURFACEDESC
modes
;
static
RECT
rect_before_create
;
static
RECT
rect_after_delete
;
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateA
)(
LPDDENUMCALLBACKA
,
LPVOID
);
static
HRESULT
(
WINAPI
*
pDirectDrawEnumerateW
)(
LPDDENUMCALLBACKW
,
LPVOID
);
...
...
@@ -83,6 +85,8 @@ static BOOL createdirectdraw(void)
{
HRESULT
rc
;
SetRect
(
&
rect_before_create
,
0
,
0
,
GetSystemMetrics
(
SM_CXSCREEN
),
GetSystemMetrics
(
SM_CYSCREEN
));
rc
=
DirectDrawCreate
(
NULL
,
&
lpDD
,
NULL
);
ok
(
rc
==
DD_OK
||
rc
==
DDERR_NODIRECTDRAWSUPPORT
,
"DirectDrawCreateEx returned: %x
\n
"
,
rc
);
if
(
!
lpDD
)
{
...
...
@@ -95,11 +99,16 @@ static BOOL createdirectdraw(void)
static
void
releasedirectdraw
(
void
)
{
if
(
lpDD
!=
NULL
)
{
IDirectDraw_Release
(
lpDD
);
lpDD
=
NULL
;
}
if
(
lpDD
!=
NULL
)
{
IDirectDraw_Release
(
lpDD
);
lpDD
=
NULL
;
SetRect
(
&
rect_after_delete
,
0
,
0
,
GetSystemMetrics
(
SM_CXSCREEN
),
GetSystemMetrics
(
SM_CYSCREEN
));
ok
(
EqualRect
(
&
rect_before_create
,
&
rect_after_delete
)
!=
0
,
"Original display mode was not restored
\n
"
);
}
}
static
BOOL
WINAPI
crash_callbackA
(
GUID
*
lpGUID
,
LPSTR
lpDriverDescription
,
...
...
@@ -414,11 +423,36 @@ static void setdisplaymode(int i)
scrn
.
right
,
scrn
.
bottom
,
virt
.
left
,
virt
.
top
,
virt
.
right
,
virt
.
bottom
);
if
(
!
EqualRect
(
&
scrn
,
&
orig_rect
))
{
HRESULT
rect_result
;
/* Check that the client rect was resized */
rc
=
GetClientRect
(
hwnd
,
&
test
);
ok
(
rc
!=
0
,
"GetClientRect returned %x
\n
"
,
rc
);
rc
=
EqualRect
(
&
scrn
,
&
test
);
todo_wine
ok
(
rc
!=
0
,
"Fullscreen window has wrong size
\n
"
);
/* Check that switching to normal cooperative level
does not restore the display mode */
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
hwnd
,
DDSCL_NORMAL
);
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel returned %x
\n
"
,
rc
);
SetRect
(
&
test
,
0
,
0
,
GetSystemMetrics
(
SM_CXSCREEN
),
GetSystemMetrics
(
SM_CYSCREEN
));
rect_result
=
EqualRect
(
&
scrn
,
&
test
);
ok
(
rect_result
!=
0
,
"Setting cooperative level to DDSCL_NORMAL changed the display mode
\n
"
);
/* Go back to fullscreen */
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
hwnd
,
DDSCL_ALLOWMODEX
|
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel returned: %x
\n
"
,
rc
);
/* If the display mode was changed, set the correct mode
to avoid irrelevant failures */
if
(
rect_result
==
0
)
{
rc
=
IDirectDraw_SetDisplayMode
(
lpDD
,
modes
[
i
].
dwWidth
,
modes
[
i
].
dwHeight
,
U1
(
modes
[
i
].
ddpfPixelFormat
).
dwRGBBitCount
);
ok
(
DD_OK
==
rc
,
"SetDisplayMode returned: %x
\n
"
,
rc
);
}
}
ok
(
GetClipCursor
(
&
r
),
"GetClipCursor() failed
\n
"
);
/* ddraw sets clip rect here to the screen size, even for
...
...
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