Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
84413298
Commit
84413298
authored
Jul 21, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Resize the window after setting the new display mode.
parent
0f9ee1b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
ddraw.c
dlls/ddraw/ddraw.c
+3
-3
d3d.c
dlls/ddraw/tests/d3d.c
+34
-2
No files found.
dlls/ddraw/ddraw.c
View file @
84413298
...
...
@@ -910,12 +910,12 @@ static HRESULT ddraw_set_display_mode(IDirectDrawImpl *ddraw, DWORD Width, DWORD
* or some drawing is in progress
*/
if
(
ddraw
->
cooperative_level
&
DDSCL_EXCLUSIVE
)
SetWindowPos
(
ddraw
->
dest_window
,
HWND_TOP
,
0
,
0
,
Width
,
Height
,
SWP_SHOWWINDOW
|
SWP_NOACTIVATE
);
/* TODO: Lose the primary surface */
hr
=
wined3d_device_set_display_mode
(
ddraw
->
wined3d_device
,
0
,
&
Mode
);
if
(
ddraw
->
cooperative_level
&
DDSCL_EXCLUSIVE
)
SetWindowPos
(
ddraw
->
dest_window
,
HWND_TOP
,
0
,
0
,
Width
,
Height
,
SWP_SHOWWINDOW
|
SWP_NOACTIVATE
);
LeaveCriticalSection
(
&
ddraw_cs
);
switch
(
hr
)
{
...
...
dlls/ddraw/tests/d3d.c
View file @
84413298
...
...
@@ -4146,6 +4146,19 @@ static void test_redundant_mode_set(void)
DestroyWindow
(
window
);
}
static
SIZE
screen_size
;
static
LRESULT
CALLBACK
mode_set_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
message
==
WM_SIZE
)
{
screen_size
.
cx
=
GetSystemMetrics
(
SM_CXSCREEN
);
screen_size
.
cy
=
GetSystemMetrics
(
SM_CYSCREEN
);
}
return
test_proc
(
hwnd
,
message
,
wparam
,
lparam
);
}
static
void
test_coop_level_mode_set
(
void
)
{
RECT
fullscreen_rect
,
r
,
s
;
...
...
@@ -4160,7 +4173,10 @@ static void test_coop_level_mode_set(void)
WM_WINDOWPOSCHANGING
,
WM_WINDOWPOSCHANGED
,
WM_SIZE
,
WM_DISPLAYCHANGE
,
/* WM_DISPLAYCHANGE, This message is received after WM_SIZE on native. However, the
* more important behaviour is that at the time the WM_SIZE message
* is processed SM_CXSCREEN and SM_CYSCREEN already have the new
* values. */
0
,
};
...
...
@@ -4177,7 +4193,7 @@ static void test_coop_level_mode_set(void)
return
;
}
wc
.
lpfnWndProc
=
tes
t_proc
;
wc
.
lpfnWndProc
=
mode_se
t_proc
;
wc
.
lpszClassName
=
"d3d7_test_wndproc_wc"
;
ok
(
RegisterClassA
(
&
wc
),
"Failed to register window class.
\n
"
);
...
...
@@ -4201,12 +4217,17 @@ static void test_coop_level_mode_set(void)
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
expect_messages
=
exclusive_messages
;
screen_size
.
cx
=
0
;
screen_size
.
cy
=
0
;
hr
=
IDirectDraw7_SetDisplayMode
(
ddraw7
,
640
,
480
,
32
,
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetDipslayMode failed, hr %#x.
\n
"
,
hr
);
ok
(
!*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
expect_messages
=
NULL
;
ok
(
screen_size
.
cx
==
s
.
right
&&
screen_size
.
cy
==
s
.
bottom
,
"Expected screen size %ux%u, got %ux%u.
\n
"
,
s
.
right
,
s
.
bottom
,
screen_size
.
cx
,
screen_size
.
cy
);
GetWindowRect
(
window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
s
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
...
...
@@ -4214,12 +4235,17 @@ static void test_coop_level_mode_set(void)
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
expect_messages
=
exclusive_messages
;
screen_size
.
cx
=
0
;
screen_size
.
cy
=
0
;
hr
=
IDirectDraw_RestoreDisplayMode
(
ddraw7
);
ok
(
SUCCEEDED
(
hr
),
"RestoreDisplayMode failed, hr %#x.
\n
"
,
hr
);
ok
(
!*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
expect_messages
=
NULL
;
ok
(
screen_size
.
cx
==
fullscreen_rect
.
right
&&
screen_size
.
cy
==
fullscreen_rect
.
bottom
,
"Expected screen size %ux%u, got %ux%u.
\n
"
,
fullscreen_rect
.
right
,
fullscreen_rect
.
bottom
,
screen_size
.
cx
,
screen_size
.
cy
);
GetWindowRect
(
window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
...
...
@@ -4234,12 +4260,15 @@ static void test_coop_level_mode_set(void)
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
expect_messages
=
normal_messages
;
screen_size
.
cx
=
0
;
screen_size
.
cy
=
0
;
hr
=
IDirectDraw7_SetDisplayMode
(
ddraw7
,
640
,
480
,
32
,
0
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetDipslayMode failed, hr %#x.
\n
"
,
hr
);
ok
(
!*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unxpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
GetWindowRect
(
window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
...
...
@@ -4247,12 +4276,15 @@ static void test_coop_level_mode_set(void)
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
expect_messages
=
normal_messages
;
screen_size
.
cx
=
0
;
screen_size
.
cy
=
0
;
hr
=
IDirectDraw_RestoreDisplayMode
(
ddraw7
);
ok
(
SUCCEEDED
(
hr
),
"RestoreDisplayMode failed, hr %#x.
\n
"
,
hr
);
ok
(
!*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unxpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
GetWindowRect
(
window
,
&
r
);
ok
(
EqualRect
(
&
r
,
&
fullscreen_rect
),
"Expected {%d, %d, %d, %d}, got {%d, %d, %d, %d}.
\n
"
,
...
...
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