From 6c43f90c50cb1c231beb4add3dcf869c83389b5f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 31 Mar 2013 18:25:27 -0600 Subject: [PATCH] wined3d: Ignore WS_VISIBLE and WS_EX_TOPMOST when dropping out of fullscreen. --- dlls/wined3d/device.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bca5a5454b5..e4b970cf62c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1044,12 +1044,21 @@ void CDECL wined3d_device_restore_fullscreen_window(struct wined3d_device *devic 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); + /* These flags are set by wined3d_device_setup_fullscreen_window, not the + * application, and we want to ignore them in the test below, since it's + * not the application's fault that they changed. Additionally, we want to + * preserve the current status of these flags (i.e. don't restore them) to + * more closely emulate the behavior of Direct3D, which leaves these flags + * alone when returning to windowed mode. */ + device->style ^= (device->style ^ style) & WS_VISIBLE; + device->exStyle ^= (device->exStyle ^ exstyle) & WS_EX_TOPMOST; + + TRACE("Restoring window style of window %p to %08x, %08x.\n", + window, device->style, device->exStyle); + filter_messages = device->filter_messages; device->filter_messages = TRUE;