Re: [PATCH 2/6] wined3d: Minimize device windows on focus loss (v3).
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached archives contains follow-up patches that implement resolution changes and add tests for CreateAdditionalSwapchain. I expect that many more small fixes will be needed for some games, similar in nature to patch 19. There are also problems in some window managers (read: those forked from Metacity)for which I haven't filed bugs yet. Am 2014-11-12 22:15, schrieb Stefan Dösinger:
Tests for d3d8 will follow after 107631 has been committed.
v3: Check for D3DCREATE_NOWINDOWCHANGES.
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.
Another patch will add an action (resize the window to match the backbuffer size) on window activation. For this reason the swapchain helper function is called on both activation and deactivation. --- 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 ee3636e..0de444b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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); }
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 25e2107..4c0948f 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 && !(swapchain->device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES)) + ShowWindow(swapchain->device_window, SW_MINIMIZE); +} diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0f302c4..5f90e9a 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;
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJUY883AAoJEN0/YqbEcdMwU/EP/2AAyRwHeT/rJJt1ocC3EgSq ttCBQSjH0plrsm1y+zIfFJ6+iNFfXooO1ub3qC980Ub32v5EV7p9yUxbbvfpRt1T aF7kh5WDfbPvpkGdAKmSo7C3gCzHratuPxLokDIiHAKnqhsknFmIr6dwVfaYKqmd 1eoJghdpuapyQ5TiTblU54b6tuTLyWmyZlxDNHFUSQaBCLvC7pR5eXo7nvARwYLK ahP87S7htMA+rqudvctwkPNWEa7F3dSayWyLoOp6qW3abBwfpbBAWS9KEfCztc6i zAE6LOuVy9IWewmZ5j87DNZJmKSJj/tgMHhdJ5BHxEcyJALjdg4qSsgp9olFBkpm 0DXjc0qlqdrdFiNMPG2y5i6N5vMuT9srVgDEjFAW40dnu3aEPSqHmPqKhDVrAs8s Ci3G9mV4uDK4JNI/sWJd632yWaDHGNZSdZYETof3DaR6a6K8IMktG0vqBKrapZ2K RzWz8DEonbIx5W1mKQROr5Wj+0Qs5+AkeQoWbWFEYuubtU0oisp3evRCPtjCLXjB GSwObVGohUNdwiVonYCAXtu3C80HNYwMGObcoB7p9ok3RQc60e6gOb1RdshfTcvF e4oEWOHOdqmbtj8gqLftx1qsnwPmK4gHc6ho2KfXaAZTnQdkdeUw6VG+pkNUxwJb zj94p5A5sSlJEUTmCnyx =LNWo -----END PGP SIGNATURE-----
participants (1)
-
Stefan Dösinger