wined3d: Minimize device windows on focus loss.

This commit is contained in:
Stefan Dösinger 2014-11-13 20:39:25 +01:00 committed by Alexandre Julliard
parent d732cadf4d
commit 45d530461b
3 changed files with 12 additions and 0 deletions

View file

@ -4983,6 +4983,11 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
}
else if (message == WM_ACTIVATEAPP)
{
UINT i;
for (i = 0; i < device->swapchain_count; i++)
wined3d_swapchain_activate(device->swapchains[i], wparam);
device->device_parent->ops->activate(device->device_parent, wparam);
}

View file

@ -1175,3 +1175,9 @@ void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain)
wined3d_resource_update_draw_binding(&swapchain->back_buffers[i]->resource);
}
}
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate)
{
if (!activate && !(swapchain->device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES))
ShowWindow(swapchain->device_window, SW_MINIMIZE);
}

View file

@ -2702,6 +2702,7 @@ struct wined3d_swapchain
void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *rect) DECLSPEC_HIDDEN;
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;