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
6fcb33f5
Commit
6fcb33f5
authored
Nov 10, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Window proc replacement depends on DDSCL_EXCLUSIVE, not DDSCL_FULLSCREEN.
parent
4503d0cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
10 deletions
+51
-10
ddraw.c
dlls/ddraw/ddraw.c
+17
-10
d3d.c
dlls/ddraw/tests/d3d.c
+34
-0
No files found.
dlls/ddraw/ddraw.c
View file @
6fcb33f5
...
...
@@ -641,12 +641,15 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
TRACE
(
"(%p) SetCooperativeLevel needs at least SetFocusWindow or Exclusive or Normal mode
\n
"
,
This
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
}
}
if
((
This
->
cooperative_level
&
DDSCL_EXCLUSIVE
)
&&
(
hwnd
!=
window
||
!
(
cooplevel
&
DDSCL_EXCLUSIVE
)))
IWineD3DDevice_ReleaseFocusWindow
(
This
->
wineD3DDevice
);
/* Do we switch from fullscreen to non-fullscreen ? */
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
&&
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
))
{
IWineD3DDevice_ReleaseFocusWindow
(
This
->
wineD3DDevice
);
IWineD3DDevice_RestoreFullscreenWindow
(
This
->
wineD3DDevice
,
This
->
dest_window
);
}
...
...
@@ -656,21 +659,25 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
if
(
cooplevel
&
DDSCL_FULLSCREEN
)
{
WINED3DDISPLAYMODE
display_mode
;
HRESULT
hr
;
IWineD3D_GetAdapterDisplayMode
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
&
display_mode
);
IWineD3DDevice_SetupFullscreenWindow
(
This
->
wineD3DDevice
,
hwnd
,
display_mode
.
Width
,
display_mode
.
Height
);
hr
=
IWineD3DDevice_AcquireFocusWindow
(
This
->
wineD3DDevice
,
hwnd
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to acquire focus window, hr %#x.
\n
"
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
}
This
->
dest_window
=
hwnd
;
}
if
((
cooplevel
&
DDSCL_EXCLUSIVE
)
&&
(
hwnd
!=
window
||
!
(
This
->
cooperative_level
&
DDSCL_EXCLUSIVE
)))
{
HRESULT
hr
=
IWineD3DDevice_AcquireFocusWindow
(
This
->
wineD3DDevice
,
hwnd
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to acquire focus window, hr %#x.
\n
"
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
}
if
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
)
{
/* Don't create a device window if a focus window is set */
...
...
dlls/ddraw/tests/d3d.c
View file @
6fcb33f5
...
...
@@ -3281,6 +3281,7 @@ static void test_wndproc(void)
0
,
};
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
{
...
...
@@ -3323,6 +3324,39 @@ static void test_wndproc(void)
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
/* DDSCL_NORMAL doesn't. */
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create IDirectDraw7 object (%#x), skipping tests.
\n
"
,
hr
);
return
;
}
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
window
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IDirectDraw7_Release
(
ddraw7
);
goto
done
;
}
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
ref
=
IDirectDraw7_Release
(
ddraw7
);
ok
(
ref
==
0
,
"The ddraw object was not properly freed: refcount %u.
\n
"
,
ref
);
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
/* The original window proc is only restored by ddraw if the current
* window proc matches the one ddraw set. */
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
{
...
...
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