diff --git a/src/config.c b/src/config.c index 206cf8b..483843f 100644 --- a/src/config.c +++ b/src/config.c @@ -112,11 +112,6 @@ void cfg_load() g_ddraw->flip_limiter.tick_length = (DWORD)(flip_len + 0.5f); } - if ((g_ddraw->fullscreen = cfg_get_bool("fullscreen", FALSE))) - { - g_config.window_rect.left = g_config.window_rect.top = -32000; - } - if (cfg_get_bool("singlecpu", TRUE)) { SetProcessAffinityMask(GetCurrentProcess(), 1); diff --git a/src/dd.c b/src/dd.c index 73773f3..c3cc184 100644 --- a/src/dd.c +++ b/src/dd.c @@ -450,9 +450,6 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl { border = FALSE; - g_config.window_rect.left = -32000; - g_config.window_rect.top = -32000; - /* prevent OpenGL from going automatically into fullscreen exclusive mode */ if (g_ddraw->renderer == ogl_render_main) nonexclusive = TRUE; @@ -672,6 +669,14 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl int x = (g_config.window_rect.left != -32000) ? g_config.window_rect.left : (cy / 2) - (g_ddraw->render.width / 2); int y = (g_config.window_rect.top != -32000) ? g_config.window_rect.top : (cx / 2) - (g_ddraw->render.height / 2); + if (nonexclusive) + { + x = y = 0; + } + + if (IsIconic(g_ddraw->hwnd)) + real_ShowWindow(g_ddraw->hwnd, SW_RESTORE); + RECT dst = { x, y, g_ddraw->render.width + x, g_ddraw->render.height + y }; AdjustWindowRect(&dst, GetWindowLong(g_ddraw->hwnd, GWL_STYLE), FALSE);