Commit 7a36efc3 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Avoid accessing the device after minimize in ddraw.

parent 222d3075
...@@ -1132,13 +1132,15 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa ...@@ -1132,13 +1132,15 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
{ {
struct wined3d_device *device = swapchain->device; struct wined3d_device *device = swapchain->device;
BOOL filter_messages = device->filter_messages; BOOL filter_messages = device->filter_messages;
BOOL focus_messages = device->wined3d->flags & WINED3D_FOCUS_MESSAGES;
/* This code is not protected by the wined3d mutex, so it may run while /* This code is not protected by the wined3d mutex, so it may run while
* wined3d_device_reset is active. Testing on Windows shows that changing * wined3d_device_reset is active. Testing on Windows shows that changing
* focus during resets and resetting during focus change events causes * focus during resets and resetting during focus change events causes
* the application to crash with an invalid memory access. */ * the application to crash with an invalid memory access. */
device->filter_messages = !(device->wined3d->flags & WINED3D_FOCUS_MESSAGES); if (!focus_messages)
device->filter_messages = 1;
if (activate) if (activate)
{ {
...@@ -1190,6 +1192,7 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa ...@@ -1190,6 +1192,7 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
ShowWindow(swapchain->device_window, SW_MINIMIZE); ShowWindow(swapchain->device_window, SW_MINIMIZE);
} }
if (!focus_messages)
device->filter_messages = filter_messages; device->filter_messages = filter_messages;
} }
......
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