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
cb076db8
Commit
cb076db8
authored
Dec 10, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move IWineD3DDeviceImpl_RestoreWindow() to swapchain.c.
parent
542590cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
68 deletions
+34
-68
device.c
dlls/wined3d/device.c
+1
-68
swapchain.c
dlls/wined3d/swapchain.c
+32
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/device.c
View file @
cb076db8
...
...
@@ -919,73 +919,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
return
WINED3D_OK
;
}
static
LONG
fullscreen_style
(
LONG
orig_style
)
{
LONG
style
=
orig_style
;
style
&=
~
WS_CAPTION
;
style
&=
~
WS_THICKFRAME
;
/* Make sure the window is managed, otherwise we won't get keyboard input */
style
|=
WS_POPUP
|
WS_SYSMENU
;
return
style
;
}
static
LONG
fullscreen_exStyle
(
LONG
orig_exStyle
)
{
LONG
exStyle
=
orig_exStyle
;
/* Filter out window decorations */
exStyle
&=
~
WS_EX_WINDOWEDGE
;
exStyle
&=
~
WS_EX_CLIENTEDGE
;
return
exStyle
;
}
/*****************************************************************************
* IWineD3DDeviceImpl_RestoreWindow
*
* Helper function that restores a windows' properties when taking it out
* of fullscreen mode
*
* Params:
* iface: Pointer to the IWineD3DDevice interface
* window: Window to setup
*
*****************************************************************************/
static
void
IWineD3DDeviceImpl_RestoreWindow
(
IWineD3DDevice
*
iface
,
HWND
window
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
LONG
style
,
exStyle
;
/* This could be a DDSCL_NORMAL -> DDSCL_NORMAL
* switch, do nothing
*/
if
(
!
This
->
style
&&
!
This
->
exStyle
)
return
;
TRACE
(
"(%p): Restoring window settings of window %p to %08x, %08x
\n
"
,
This
,
window
,
This
->
style
,
This
->
exStyle
);
style
=
GetWindowLongW
(
window
,
GWL_STYLE
);
exStyle
=
GetWindowLongW
(
window
,
GWL_EXSTYLE
);
/* Only restore the style if the application didn't modify it during the fullscreen phase.
* Some applications change it before calling Reset() when switching between windowed and
* fullscreen modes(HL2), some depend on the original style(Eve Online)
*/
if
(
style
==
fullscreen_style
(
This
->
style
)
&&
exStyle
==
fullscreen_exStyle
(
This
->
exStyle
))
{
SetWindowLongW
(
window
,
GWL_STYLE
,
This
->
style
);
SetWindowLongW
(
window
,
GWL_EXSTYLE
,
This
->
exStyle
);
}
/* Delete the old values */
This
->
style
=
0
;
This
->
exStyle
=
0
;
/* Inform the window about the update */
SetWindowPos
(
window
,
0
/* InsertAfter, ignored */
,
0
,
0
,
0
,
0
,
/* Pos, Size, ignored */
SWP_FRAMECHANGED
|
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOZORDER
);
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateSwapChain
(
IWineD3DDevice
*
iface
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IWineD3DSwapChain
**
swapchain
,
IUnknown
*
parent
,
WINED3DSURFTYPE
surface_type
)
...
...
@@ -6568,7 +6501,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
}
}
else
if
(
swapchain
->
win_handle
&&
!
swapchain
->
presentParms
.
Windowed
)
{
/* Fullscreen -> windowed switch */
IWineD3DDeviceImpl_RestoreWindow
(
iface
,
swapchain
->
win_handle
);
swapchain_restore_fullscreen_window
(
swapchain
);
}
swapchain
->
presentParms
.
Windowed
=
pPresentationParameters
->
Windowed
;
}
else
if
(
!
pPresentationParameters
->
Windowed
)
{
...
...
dlls/wined3d/swapchain.c
View file @
cb076db8
...
...
@@ -602,6 +602,38 @@ void swapchain_setup_fullscreen_window(IWineD3DSwapChainImpl *swapchain, UINT w,
SetWindowPos
(
window
,
HWND_TOP
,
0
,
0
,
w
,
h
,
SWP_FRAMECHANGED
|
SWP_SHOWWINDOW
);
}
void
swapchain_restore_fullscreen_window
(
IWineD3DSwapChainImpl
*
swapchain
)
{
IWineD3DDeviceImpl
*
device
=
swapchain
->
device
;
HWND
window
=
swapchain
->
win_handle
;
LONG
style
,
exstyle
;
if
(
!
device
->
style
&&
!
device
->
exStyle
)
return
;
TRACE
(
"Restoring window style of window %p to %08x, %08x.
\n
"
,
window
,
device
->
style
,
device
->
exStyle
);
style
=
GetWindowLongW
(
window
,
GWL_STYLE
);
exstyle
=
GetWindowLongW
(
window
,
GWL_EXSTYLE
);
/* Only restore the style if the application didn't modify it during the
* fullscreen phase. Some applications change it before calling Reset()
* when switching between windowed and fullscreen modes (HL2), some
* depend on the original style (Eve Online). */
if
(
style
==
fullscreen_style
(
device
->
style
)
&&
exstyle
==
fullscreen_exstyle
(
device
->
exStyle
))
{
SetWindowLongW
(
window
,
GWL_STYLE
,
device
->
style
);
SetWindowLongW
(
window
,
GWL_EXSTYLE
,
device
->
exStyle
);
}
/* Delete the old values. */
device
->
style
=
0
;
device
->
exStyle
=
0
;
SetWindowPos
(
window
,
0
,
0
,
0
,
0
,
0
,
SWP_FRAMECHANGED
|
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOZORDER
);
}
HRESULT
swapchain_init
(
IWineD3DSwapChainImpl
*
swapchain
,
WINED3DSURFTYPE
surface_type
,
IWineD3DDeviceImpl
*
device
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IUnknown
*
parent
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
cb076db8
...
...
@@ -2453,6 +2453,7 @@ struct wined3d_context *swapchain_create_context_for_thread(IWineD3DSwapChain *i
HRESULT
swapchain_init
(
IWineD3DSwapChainImpl
*
swapchain
,
WINED3DSURFTYPE
surface_type
,
IWineD3DDeviceImpl
*
device
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IUnknown
*
parent
)
DECLSPEC_HIDDEN
;
void
swapchain_setup_fullscreen_window
(
IWineD3DSwapChainImpl
*
swapchain
,
UINT
w
,
UINT
h
)
DECLSPEC_HIDDEN
;
void
swapchain_restore_fullscreen_window
(
IWineD3DSwapChainImpl
*
swapchain
)
DECLSPEC_HIDDEN
;
#define DEFAULT_REFRESH_RATE 0
...
...
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