[PATCH 02/10] wined3d: Minimize device windows on focus loss (v2).

Stefan Dösinger stefan at codeweavers.com
Thu Sep 25 07:24:18 CDT 2014


v2: Move to wined3d. The different behavior in d3d9ex was due to a
hidden window and not a difference how d3d9ex handles focus loss. See
patch 7.
---
 dlls/wined3d/device.c          | 5 +++++
 dlls/wined3d/swapchain.c       | 6 ++++++
 dlls/wined3d/wined3d_private.h | 1 +
 3 files changed, 12 insertions(+)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a214442..2a5f59b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4984,6 +4984,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);
     }
 
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 1eb2abb..f308731 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -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)
+        ShowWindow(swapchain->device_window, SW_MINIMIZE);
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 30a3321..46ac6b3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2701,6 +2701,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;
-- 
1.8.5.5




More information about the wine-patches mailing list