From: Zhiyi Zhang zzhang@codeweavers.com
Tidy Cauldron (2708320), a Unity game, uses EnumWindows() to find the first window in the current thread and maximizes the window when changing to windowed mode. However, before this patch, the IME UI window and the DXGI fallback device window are on top of the game window at creation and thus they could get maximized instead. This causes the game window to lose focus and freeze. --- dlls/d3d11/tests/d3d11.c | 2 -- dlls/dxgi/factory.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index b4c585b2b41..67367425b7d 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -2087,7 +2087,6 @@ static void test_create_device_child(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
EnumWindows(enum_first_current_thread_window_proc, (LPARAM)&result_hwnd); - todo_wine ok(result_hwnd == hwnd, "Got unexpected window %p.\n", result_hwnd);
ID3D11Device_Release(device); @@ -2099,7 +2098,6 @@ static void test_create_device_child(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
EnumWindows(enum_first_current_thread_window_proc, (LPARAM)&result_hwnd); - todo_wine ok(result_hwnd == hwnd, "Got unexpected window %p.\n", result_hwnd);
ID3D11Device_Release(device); diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 32d54f033eb..ebdb42a3806 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -617,6 +617,7 @@ HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) ERR("Failed to create a window.\n"); return NULL; } + SetWindowPos(factory->device_window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); TRACE("Created device window %p for factory %p.\n", factory->device_window, factory); }