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
7e3985e1
Commit
7e3985e1
authored
Nov 08, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Setup the device window in SetCooperativeLevel().
parent
b898130a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
28 deletions
+60
-28
device.c
dlls/d3d8/device.c
+8
-1
device.c
dlls/d3d9/device.c
+17
-7
ddraw.c
dlls/ddraw/ddraw.c
+14
-5
d3d.c
dlls/ddraw/tests/d3d.c
+3
-0
ddrawmodes.c
dlls/ddraw/tests/ddrawmodes.c
+1
-1
device.c
dlls/wined3d/device.c
+9
-5
swapchain.c
dlls/wined3d/swapchain.c
+0
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-2
wined3d.idl
include/wine/wined3d.idl
+8
-0
No files found.
dlls/d3d8/device.c
View file @
7e3985e1
...
...
@@ -2855,7 +2855,9 @@ HRESULT device_init(IDirect3DDevice8Impl *device, IWineD3D *wined3d, UINT adapte
if
(
!
parameters
->
Windowed
)
{
if
(
!
focus_window
)
focus_window
=
parameters
->
hDeviceWindow
;
HWND
device_window
=
parameters
->
hDeviceWindow
;
if
(
!
focus_window
)
focus_window
=
device_window
;
if
(
FAILED
(
hr
=
IWineD3DDevice_AcquireFocusWindow
(
device
->
WineD3DDevice
,
focus_window
)))
{
ERR
(
"Failed to acquire focus window, hr %#x.
\n
"
,
hr
);
...
...
@@ -2864,6 +2866,11 @@ HRESULT device_init(IDirect3DDevice8Impl *device, IWineD3D *wined3d, UINT adapte
HeapFree
(
GetProcessHeap
(),
0
,
device
->
handle_table
.
entries
);
return
hr
;
}
if
(
!
device_window
)
device_window
=
focus_window
;
IWineD3DDevice_SetupFullscreenWindow
(
device
->
WineD3DDevice
,
device_window
,
parameters
->
BackBufferWidth
,
parameters
->
BackBufferHeight
);
}
if
(
flags
&
D3DCREATE_MULTITHREADED
)
IWineD3DDevice_SetMultithreaded
(
device
->
WineD3DDevice
);
...
...
dlls/d3d9/device.c
View file @
7e3985e1
...
...
@@ -3271,6 +3271,16 @@ HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapte
return
hr
;
}
if
(
flags
&
D3DCREATE_ADAPTERGROUP_DEVICE
)
{
WINED3DCAPS
caps
;
IWineD3D_GetDeviceCaps
(
wined3d
,
adapter
,
device_type
,
&
caps
);
count
=
caps
.
NumberOfAdaptersInGroup
;
}
if
(
flags
&
D3DCREATE_MULTITHREADED
)
IWineD3DDevice_SetMultithreaded
(
device
->
WineD3DDevice
);
if
(
!
parameters
->
Windowed
)
{
if
(
!
focus_window
)
focus_window
=
parameters
->
hDeviceWindow
;
...
...
@@ -3281,17 +3291,17 @@ HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapte
wined3d_mutex_unlock
();
return
hr
;
}
}
if
(
flags
&
D3DCREATE_ADAPTERGROUP_DEVICE
)
for
(
i
=
0
;
i
<
count
;
++
i
)
{
WINED3DCAPS
caps
;
HWND
device_window
=
parameters
[
i
].
hDeviceWindow
;
IWineD3D_GetDeviceCaps
(
wined3d
,
adapter
,
device_type
,
&
caps
);
count
=
caps
.
NumberOfAdaptersInGroup
;
if
(
!
device_window
)
device_window
=
focus_window
;
IWineD3DDevice_SetupFullscreenWindow
(
device
->
WineD3DDevice
,
device_window
,
parameters
[
i
].
BackBufferWidth
,
parameters
[
i
].
BackBufferHeight
);
}
}
if
(
flags
&
D3DCREATE_MULTITHREADED
)
IWineD3DDevice_SetMultithreaded
(
device
->
WineD3DDevice
);
wined3d_parameters
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
wined3d_parameters
)
*
count
);
if
(
!
wined3d_parameters
)
...
...
dlls/ddraw/ddraw.c
View file @
7e3985e1
...
...
@@ -644,16 +644,23 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
}
/* Do we switch from fullscreen to non-fullscreen ? */
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
&&
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
)
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
&&
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
))
{
IWineD3DDevice_ReleaseFocusWindow
(
This
->
wineD3DDevice
);
IWineD3DDevice_RestoreFullscreenWindow
(
This
->
wineD3DDevice
,
This
->
dest_window
);
}
/* 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
)
if
(
cooplevel
&
DDSCL_FULLSCREEN
)
{
HRESULT
hr
=
IWineD3DDevice_AcquireFocusWindow
(
This
->
wineD3DDevice
,
hwnd
);
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
);
...
...
@@ -797,6 +804,8 @@ static HRESULT ddraw_set_display_mode(IDirectDraw7 *iface, DWORD Width, DWORD He
hr
=
IWineD3DDevice_SetDisplayMode
(
This
->
wineD3DDevice
,
0
,
/* First swapchain */
&
Mode
);
IWineD3DDevice_RestoreFullscreenWindow
(
This
->
wineD3DDevice
,
This
->
dest_window
);
IWineD3DDevice_SetupFullscreenWindow
(
This
->
wineD3DDevice
,
This
->
dest_window
,
Width
,
Height
);
LeaveCriticalSection
(
&
ddraw_cs
);
switch
(
hr
)
{
...
...
dlls/ddraw/tests/d3d.c
View file @
7e3985e1
...
...
@@ -3273,6 +3273,9 @@ static void test_wndproc(void)
static
const
UINT
messages
[]
=
{
WM_WINDOWPOSCHANGING
,
WM_MOVE
,
WM_SIZE
,
WM_WINDOWPOSCHANGING
,
WM_ACTIVATE
,
WM_SETFOCUS
,
0
,
...
...
dlls/ddraw/tests/ddrawmodes.c
View file @
7e3985e1
...
...
@@ -779,7 +779,7 @@ static void testcooperativelevels_exclusive(void)
/* rect_before_create is assumed to hold the screen rect */
GetClientRect
(
hwnd
,
&
window_rect
);
rc
=
EqualRect
(
&
rect_before_create
,
&
window_rect
);
todo_wine
ok
(
rc
!=
0
,
"Fullscreen window has wrong size
\n
"
);
ok
(
rc
,
"Fullscreen window has wrong size.
\n
"
);
/* Set the focus window. Should fail */
rc
=
IDirectDraw_SetCooperativeLevel
(
lpDD
,
...
...
dlls/wined3d/device.c
View file @
7e3985e1
...
...
@@ -1767,8 +1767,9 @@ static LONG fullscreen_exstyle(LONG exstyle)
return
exstyle
;
}
void
device_setup_fullscreen_window
(
IWineD3DDeviceImpl
*
devi
ce
,
HWND
window
,
UINT
w
,
UINT
h
)
static
void
WINAPI
IWineD3DDeviceImpl_SetupFullscreenWindow
(
IWineD3DDevice
*
ifa
ce
,
HWND
window
,
UINT
w
,
UINT
h
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
iface
;
BOOL
filter_messages
;
LONG
style
,
exstyle
;
...
...
@@ -1799,8 +1800,9 @@ void device_setup_fullscreen_window(IWineD3DDeviceImpl *device, HWND window, UIN
device
->
filter_messages
=
filter_messages
;
}
void
device_restore_fullscreen_window
(
IWineD3DDeviceImpl
*
devi
ce
,
HWND
window
)
static
void
WINAPI
IWineD3DDeviceImpl_RestoreFullscreenWindow
(
IWineD3DDevice
*
ifa
ce
,
HWND
window
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
iface
;
BOOL
filter_messages
;
LONG
style
,
exstyle
;
...
...
@@ -6454,7 +6456,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
}
/* switch from windowed to fs */
device_setup_fullscreen_window
(
This
,
swapchain
->
device_window
,
IWineD3DDevice_SetupFullscreenWindow
(
iface
,
swapchain
->
device_window
,
pPresentationParameters
->
BackBufferWidth
,
pPresentationParameters
->
BackBufferHeight
);
}
...
...
@@ -6469,7 +6471,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
else
if
(
!
swapchain
->
presentParms
.
Windowed
)
{
/* Fullscreen -> windowed switch */
device_restore_fullscreen_window
(
This
,
swapchain
->
device_window
);
IWineD3DDevice_RestoreFullscreenWindow
(
iface
,
swapchain
->
device_window
);
IWineD3DDevice_ReleaseFocusWindow
(
iface
);
}
swapchain
->
presentParms
.
Windowed
=
pPresentationParameters
->
Windowed
;
...
...
@@ -6485,7 +6487,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
*/
This
->
style
=
0
;
This
->
exStyle
=
0
;
device_setup_fullscreen_window
(
This
,
swapchain
->
device_window
,
IWineD3DDevice_SetupFullscreenWindow
(
iface
,
swapchain
->
device_window
,
pPresentationParameters
->
BackBufferWidth
,
pPresentationParameters
->
BackBufferHeight
);
This
->
style
=
style
;
...
...
@@ -6888,6 +6890,8 @@ static const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_GetSurfaceFromDC
,
IWineD3DDeviceImpl_AcquireFocusWindow
,
IWineD3DDeviceImpl_ReleaseFocusWindow
,
IWineD3DDeviceImpl_SetupFullscreenWindow
,
IWineD3DDeviceImpl_RestoreFullscreenWindow
,
};
HRESULT
device_init
(
IWineD3DDeviceImpl
*
device
,
IWineD3DImpl
*
wined3d
,
...
...
dlls/wined3d/swapchain.c
View file @
7e3985e1
...
...
@@ -581,13 +581,6 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
swapchain
->
win_handle
=
window
;
swapchain
->
device_window
=
window
;
if
(
!
present_parameters
->
Windowed
&&
window
)
{
device_setup_fullscreen_window
(
device
,
window
,
present_parameters
->
BackBufferWidth
,
present_parameters
->
BackBufferHeight
);
}
IWineD3D_GetAdapterDisplayMode
(
device
->
wined3d
,
adapter
->
ordinal
,
&
mode
);
swapchain
->
orig_width
=
mode
.
Width
;
swapchain
->
orig_height
=
mode
.
Height
;
...
...
dlls/wined3d/wined3d_private.h
View file @
7e3985e1
...
...
@@ -1773,8 +1773,6 @@ LRESULT device_process_message(IWineD3DDeviceImpl *device, HWND window, BOOL uni
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
,
WNDPROC
proc
)
DECLSPEC_HIDDEN
;
void
device_resource_add
(
IWineD3DDeviceImpl
*
This
,
IWineD3DResource
*
resource
)
DECLSPEC_HIDDEN
;
void
device_resource_released
(
IWineD3DDeviceImpl
*
This
,
IWineD3DResource
*
resource
)
DECLSPEC_HIDDEN
;
void
device_restore_fullscreen_window
(
IWineD3DDeviceImpl
*
device
,
HWND
hwnd
)
DECLSPEC_HIDDEN
;
void
device_setup_fullscreen_window
(
IWineD3DDeviceImpl
*
device
,
HWND
hwnd
,
UINT
w
,
UINT
h
)
DECLSPEC_HIDDEN
;
void
device_stream_info_from_declaration
(
IWineD3DDeviceImpl
*
This
,
BOOL
use_vshader
,
struct
wined3d_stream_info
*
stream_info
,
BOOL
*
fixup
)
DECLSPEC_HIDDEN
;
void
device_switch_onscreen_ds
(
IWineD3DDeviceImpl
*
device
,
struct
wined3d_context
*
context
,
...
...
include/wine/wined3d.idl
View file @
7e3985e1
...
...
@@ -3374,6 +3374,14 @@ interface IWineD3DDevice : IUnknown
)
;
void
ReleaseFocusWindow
(
)
;
void
SetupFullscreenWindow
(
[
in
]
HWND
window
,
[
in
]
UINT
w
,
[
in
]
UINT
h
)
;
void
RestoreFullscreenWindow
(
[
in
]
HWND
window
)
;
}
IWineD3D
*
__stdcall
WineDirect3DCreate
(
UINT
dxVersion
,
void
*
parent
)
;
...
...
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