Stefan Dösinger : wined3d: Only restore the style and exStyle when it is untouched.
Alexandre Julliard
julliard at winehq.org
Tue Mar 11 10:51:45 CDT 2008
Module: wine
Branch: master
Commit: c81b114269c2d4a5d1011ffeffebc227b1f9d7a3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c81b114269c2d4a5d1011ffeffebc227b1f9d7a3
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Mar 10 22:20:50 2008 +0100
wined3d: Only restore the style and exStyle when it is untouched.
---
dlls/wined3d/device.c | 46 ++++++++++++++++++++++++++++++++++++----------
1 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 32f6c64..b4d508e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1248,6 +1248,27 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
* window: Window to setup
*
*****************************************************************************/
+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;
+}
+
static void WINAPI IWineD3DDeviceImpl_SetupFullscreenWindow(IWineD3DDevice *iface, HWND window) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
@@ -1267,14 +1288,8 @@ static void WINAPI IWineD3DDeviceImpl_SetupFullscreenWindow(IWineD3DDevice *ifac
This->style = style;
This->exStyle = exStyle;
- /* Filter out window decorations */
- style &= ~WS_CAPTION;
- style &= ~WS_THICKFRAME;
- exStyle &= ~WS_EX_WINDOWEDGE;
- exStyle &= ~WS_EX_CLIENTEDGE;
-
- /* Make sure the window is managed, otherwise we won't get keyboard input */
- style |= WS_POPUP | WS_SYSMENU;
+ style = fullscreen_style(style);
+ exStyle = fullscreen_exStyle(exStyle);
TRACE("Old style was %08x,%08x, setting to %08x,%08x\n",
This->style, This->exStyle, style, exStyle);
@@ -1301,6 +1316,7 @@ static void WINAPI IWineD3DDeviceImpl_SetupFullscreenWindow(IWineD3DDevice *ifac
*****************************************************************************/
static void WINAPI IWineD3DDeviceImpl_RestoreWindow(IWineD3DDevice *iface, HWND window) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
+ LONG style, exStyle;
/* This could be a DDSCL_NORMAL -> DDSCL_NORMAL
* switch, do nothing
@@ -1310,8 +1326,18 @@ static void WINAPI IWineD3DDeviceImpl_RestoreWindow(IWineD3DDevice *iface, HWND
TRACE("(%p): Restoring window settings of window %p to %08x, %08x\n",
This, window, This->style, This->exStyle);
- SetWindowLongW(window, GWL_STYLE, This->style);
- SetWindowLongW(window, GWL_EXSTYLE, 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_style(This->exStyle)) {
+ SetWindowLongW(window, GWL_STYLE, This->style);
+ SetWindowLongW(window, GWL_EXSTYLE, This->exStyle);
+ }
/* Delete the old values */
This->style = 0;
More information about the wine-cvs
mailing list