Commit 222d3075 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Deactivate the device before minimizing the window.

This fixes tabbing out of Deus Ex Game of the Year edition. Signed-off-by: 's avatarStefan Dösinger <stefan@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 4e80641d
...@@ -5319,8 +5319,6 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL ...@@ -5319,8 +5319,6 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
for (i = 0; i < device->swapchain_count; i++) for (i = 0; i < device->swapchain_count; i++)
wined3d_swapchain_activate(device->swapchains[i], wparam); wined3d_swapchain_activate(device->swapchains[i], wparam);
device->device_parent->ops->activate(device->device_parent, wparam);
} }
else if (message == WM_SYSCOMMAND) else if (message == WM_SYSCOMMAND)
{ {
......
...@@ -1162,6 +1162,9 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa ...@@ -1162,6 +1162,9 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
device->adapter->ordinal, &swapchain->d3d_mode))) device->adapter->ordinal, &swapchain->d3d_mode)))
ERR("Failed to set display mode.\n"); ERR("Failed to set display mode.\n");
} }
if (swapchain == device->swapchains[0])
device->device_parent->ops->activate(device->device_parent, TRUE);
} }
else else
{ {
...@@ -1171,6 +1174,17 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa ...@@ -1171,6 +1174,17 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
swapchain->reapply_mode = TRUE; swapchain->reapply_mode = TRUE;
/* Some DDraw apps (Deus Ex: GOTY, and presumably all UT 1 based games) destroy the device
* during window minimization. Do our housekeeping now, as the device may not exist after
* the ShowWindow call.
*
* In d3d9, the device is marked lost after the window is minimized. If we find an app
* that needs this behavior (e.g. because it calls TestCooperativeLevel in the window proc)
* we'll have to control this via a create flag. Note that the device and swapchain are not
* safe to access after the ShowWindow call. */
if (swapchain == device->swapchains[0])
device->device_parent->ops->activate(device->device_parent, FALSE);
if (!(device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES) if (!(device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES)
&& IsWindowVisible(swapchain->device_window)) && IsWindowVisible(swapchain->device_window))
ShowWindow(swapchain->device_window, SW_MINIMIZE); ShowWindow(swapchain->device_window, SW_MINIMIZE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment