wined3d: Filter messages for fullscreen mode changes.

This fixes a regression introduced by commit
d9f8cba50f.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-12-13 13:10:38 +01:00 committed by Alexandre Julliard
parent 37daa35737
commit e2e0c747a8
2 changed files with 8 additions and 3 deletions

View File

@ -4310,7 +4310,7 @@ static void test_reset_fullscreen(void)
ok(SUCCEEDED(reset_device(device, &device_desc)), "Failed to reset device.\n");
flush_events();
todo_wine ok(!wm_size_received, "Received unexpected WM_SIZE message.\n");
ok(!wm_size_received, "Received unexpected WM_SIZE message.\n");
cleanup:
if (device) IDirect3DDevice9_Release(device);

View File

@ -1525,6 +1525,7 @@ HRESULT CDECL wined3d_swapchain_set_fullscreen(struct wined3d_swapchain *swapcha
if (swapchain->desc.windowed)
{
/* Switch from windowed to fullscreen */
HWND focus_window = device->create_parms.focus_window;
if (!focus_window)
focus_window = swapchain->device_window;
@ -1534,20 +1535,24 @@ HRESULT CDECL wined3d_swapchain_set_fullscreen(struct wined3d_swapchain *swapcha
return hr;
}
/* switch from windowed to fs */
wined3d_device_setup_fullscreen_window(device, swapchain->device_window, width, height);
}
else
{
/* Fullscreen -> fullscreen mode change */
BOOL filter_messages = device->filter_messages;
device->filter_messages = TRUE;
MoveWindow(swapchain->device_window, 0, 0, width, height, TRUE);
device->filter_messages = filter_messages;
}
swapchain->d3d_mode = actual_mode;
}
else if (!swapchain->desc.windowed)
{
RECT *window_rect = NULL;
/* Fullscreen -> windowed switch */
RECT *window_rect = NULL;
if (swapchain->desc.flags & WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT)
window_rect = &swapchain->original_window_rect;
wined3d_device_restore_fullscreen_window(device, swapchain->device_window, window_rect);