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
7661e898
Commit
7661e898
authored
Nov 03, 2010
by
David Adam
Committed by
Alexandre Julliard
Nov 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Exclusive mode is the corner case for SetCooperative, not the normal mode.
parent
7b8ac6a2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
59 deletions
+25
-59
ddraw.c
dlls/ddraw/ddraw.c
+16
-50
ddrawmodes.c
dlls/ddraw/tests/ddrawmodes.c
+9
-9
No files found.
dlls/ddraw/ddraw.c
View file @
7661e898
...
...
@@ -602,7 +602,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return
DDERR_INVALIDPARAMS
;
}
if
(
(
This
->
cooperative_level
&
DDSCL_
FULLSCREEN
)
&&
window
)
if
(
(
This
->
cooperative_level
&
DDSCL_
EXCLUSIVE
)
&&
window
)
{
TRACE
(
"Setting DDSCL_SETFOCUSWINDOW with an already set window, returning DDERR_HWNDALREADYSET
\n
"
);
LeaveCriticalSection
(
&
ddraw_cs
);
...
...
@@ -626,60 +626,32 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
}
/* DDSCL_NORMAL or DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE */
if
(
cooplevel
&
DDSCL_
NORMAL
)
if
(
cooplevel
&
DDSCL_
EXCLUSIVE
)
{
/* Can't coexist with fullscreen or exclusive */
if
(
cooplevel
&
(
DDSCL_FULLSCREEN
|
DDSCL_EXCLUSIVE
)
)
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
||
!
hwnd
)
{
TRACE
(
"(%p) DDSCL_
NORMAL is not compative with DDSCL_FULLSCREEN or DDSCL_EXCLUSIVE
\n
"
,
This
);
TRACE
(
"(%p) DDSCL_
EXCLUSIVE needs DDSCL_FULLSCREEN and a window
\n
"
,
This
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
}
/* Switching from fullscreen? */
if
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
{
This
->
cooperative_level
&=
~
DDSCL_FULLSCREEN
;
This
->
cooperative_level
&=
~
DDSCL_EXCLUSIVE
;
This
->
cooperative_level
&=
~
DDSCL_ALLOWMODEX
;
IWineD3DDevice_ReleaseFocusWindow
(
This
->
wineD3DDevice
);
}
/* Don't override focus windows or private device windows */
if
(
hwnd
&&
!
(
This
->
focuswindow
)
&&
!
(
This
->
devicewindow
)
&&
(
hwnd
!=
window
)
)
else
if
(
!
(
cooplevel
&
DDSCL_NORMAL
)
)
{
This
->
dest_window
=
hwnd
;
}
}
else
if
(
cooplevel
&
DDSCL_FULLSCREEN
)
{
/* Needs DDSCL_EXCLUSIVE */
if
(
!
(
cooplevel
&
DDSCL_EXCLUSIVE
)
)
{
TRACE
(
"(%p) DDSCL_FULLSCREEN needs DDSCL_EXCLUSIVE
\n
"
,
This
);
TRACE
(
"(%p) SetCooperativeLevel needs at least SetFocusWindow or Exclusive or Normal mode
\n
"
,
This
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
}
/* Need a HWND
if(hwnd == 0)
{
TRACE("(%p) DDSCL_FULLSCREEN needs a HWND\n", This);
return DDERR_INVALIDPARAMS;
}
*/
This
->
cooperative_level
&=
~
DDSCL_NORMAL
;
/* Do we switch from fullscreen to non-fullscreen ? */
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
&&
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
)
IWineD3DDevice_ReleaseFocusWindow
(
This
->
wineD3DDevice
);
/* Don't override focus windows or private device windows */
if
(
hwnd
&&
!
(
This
->
focuswindow
)
&&
!
(
This
->
devicewindow
)
&&
(
hwnd
!=
window
)
)
if
(
hwnd
&&
!
This
->
focuswindow
&&
!
This
->
devicewindow
&&
(
hwnd
!=
window
))
{
if
(
cooplevel
&
DDSCL_FULLSCREEN
)
{
HRESULT
hr
=
IWineD3DDevice_AcquireFocusWindow
(
This
->
wineD3DDevice
,
hwnd
);
if
(
FAILED
(
hr
))
...
...
@@ -688,14 +660,8 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
This
->
dest_window
=
hwnd
;
}
}
else
if
(
cooplevel
&
DDSCL_EXCLUSIVE
)
{
TRACE
(
"(%p) DDSCL_EXCLUSIVE needs DDSCL_FULLSCREEN
\n
"
,
This
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
This
->
dest_window
=
hwnd
;
}
if
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
)
...
...
@@ -736,7 +702,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
WARN
(
"(%p) Unhandled flag DDSCL_FPUSETUP, harmless
\n
"
,
This
);
/* Store the cooperative_level */
This
->
cooperative_level
|
=
cooplevel
;
This
->
cooperative_level
=
cooplevel
;
TRACE
(
"SetCooperativeLevel retuning DD_OK
\n
"
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
...
...
dlls/ddraw/tests/ddrawmodes.c
View file @
7661e898
...
...
@@ -565,10 +565,10 @@ static void testcooperativelevels_normal(void)
skip
(
"Failed to create the second window
\n
"
);
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
hwnd
,
DDSCL_FULLSCREEN
|
DDSCL_EXCLUSIVE
|
DDSCL_NORMAL
);
todo_wine
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x
\n
"
,
rc
);
if
(
sfw
)
todo_wine
ok
(
GetForegroundWindow
()
==
hwnd
,
"Expected the main windows (%p) for foreground, received the second one (%p)
\n
"
,
hwnd
,
hwnd2
);
ok
(
GetForegroundWindow
()
==
hwnd
,
"Expected the main windows (%p) for foreground, received the second one (%p)
\n
"
,
hwnd
,
hwnd2
);
/* Try creating a double buffered primary in fullscreen + exclusive + normal mode */
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
surfacedesc
,
&
surface
,
NULL
);
...
...
@@ -577,8 +577,8 @@ static void testcooperativelevels_normal(void)
skip
(
"Unsupported mode
\n
"
);
else
{
todo_wine
ok
(
rc
==
DD_OK
,
"IDirectDraw_CreateSurface returned %08x
\n
"
,
rc
);
todo_wine
ok
(
surface
!=
NULL
,
"Returned NULL surface pointer
\n
"
);
ok
(
rc
==
DD_OK
,
"IDirectDraw_CreateSurface returned %08x
\n
"
,
rc
);
ok
(
surface
!=
NULL
,
"Returned NULL surface pointer
\n
"
);
}
if
(
surface
&&
surface
!=
(
IDirectDrawSurface
*
)
0xdeadbeef
)
IDirectDrawSurface_Release
(
surface
);
...
...
@@ -592,13 +592,13 @@ static void testcooperativelevels_normal(void)
if
(
hwnd2
)
sfw
=
SetForegroundWindow
(
hwnd2
);
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
hwnd
,
DDSCL_FULLSCREEN
|
DDSCL_NORMAL
);
todo_wine
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_NORMAL) returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_NORMAL) returned: %x
\n
"
,
rc
);
if
(
sfw
)
ok
(
GetForegroundWindow
()
==
hwnd2
,
"Expected the second windows (%p) for foreground, received the main one (%p)
\n
"
,
hwnd2
,
hwnd
);
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
NULL
,
DDSCL_FULLSCREEN
|
DDSCL_NORMAL
);
todo_wine
ok
(
rc
==
DD_OK
,
"Expected DD_OK, received %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"Expected DD_OK, received %x
\n
"
,
rc
);
/* Try creating a double buffered primary in fullscreen + normal mode */
rc
=
IDirectDraw_CreateSurface
(
lpDD
,
&
surfacedesc
,
&
surface
,
NULL
);
...
...
@@ -645,13 +645,13 @@ static void testcooperativelevels_normal(void)
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
hwnd
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel(DDSCL_NORMAL | FULLSCREEN) returned: %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"SetCooperativeLevel(DDSCL_NORMAL | FULLSCREEN) returned: %x
\n
"
,
rc
);
if
(
sfw
)
ok
(
GetForegroundWindow
()
==
hwnd2
,
"Expected the second windows (%p) for foreground, received the main one (%p)
\n
"
,
hwnd2
,
hwnd
);
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
NULL
,
DDSCL_NORMAL
|
DDSCL_FULLSCREEN
);
todo_wine
ok
(
rc
==
DD_OK
,
"Expected DD_OK, received %x
\n
"
,
rc
);
ok
(
rc
==
DD_OK
,
"Expected DD_OK, received %x
\n
"
,
rc
);
/* Set the focus window */
...
...
@@ -761,7 +761,7 @@ static void testcooperativelevels_exclusive(void)
/* Full screen mode + exclusive mode */
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
NULL
,
DDSCL_FULLSCREEN
|
DDSCL_EXCLUSIVE
);
todo_wine
ok
(
rc
==
DDERR_INVALIDPARAMS
,
"Expected DDERR_INVALIDPARAMS, received %x
\n
"
,
rc
);
ok
(
rc
==
DDERR_INVALIDPARAMS
,
"Expected DDERR_INVALIDPARAMS, received %x
\n
"
,
rc
);
sfw
=
FALSE
;
if
(
hwnd2
)
...
...
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