mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
fix window resize and maximize for macOS + fix resize on linux
This commit is contained in:
parent
95a5f7231e
commit
ca6c447ae6
@ -65,7 +65,6 @@ typedef struct CNCDDRAWCONFIG
|
|||||||
BOOL fix_alt_key_stuck;
|
BOOL fix_alt_key_stuck;
|
||||||
BOOL fix_not_responding;
|
BOOL fix_not_responding;
|
||||||
BOOL no_compat_warning;
|
BOOL no_compat_warning;
|
||||||
BOOL wine_allow_resize;
|
|
||||||
int guard_lines;
|
int guard_lines;
|
||||||
int max_resolutions;
|
int max_resolutions;
|
||||||
BOOL lock_surfaces;
|
BOOL lock_surfaces;
|
||||||
|
@ -78,7 +78,6 @@ void cfg_load()
|
|||||||
GET_BOOL(GameHandlesClose, "game_handles_close", FALSE);
|
GET_BOOL(GameHandlesClose, "game_handles_close", FALSE);
|
||||||
GET_BOOL(g_config.fix_not_responding, "fix_not_responding", FALSE);
|
GET_BOOL(g_config.fix_not_responding, "fix_not_responding", FALSE);
|
||||||
GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
|
GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
|
||||||
GET_BOOL(g_config.wine_allow_resize, "wine_allow_resize", FALSE);
|
|
||||||
GET_INT(g_config.guard_lines, "guard_lines", 200);
|
GET_INT(g_config.guard_lines, "guard_lines", 200);
|
||||||
GET_INT(g_config.max_resolutions, "max_resolutions", 0);
|
GET_INT(g_config.max_resolutions, "max_resolutions", 0);
|
||||||
GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE);
|
GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE);
|
||||||
@ -314,7 +313,6 @@ static void cfg_create_ini()
|
|||||||
"game_handles_close=false\n"
|
"game_handles_close=false\n"
|
||||||
"fix_not_responding=false\n"
|
"fix_not_responding=false\n"
|
||||||
"no_compat_warning=false\n"
|
"no_compat_warning=false\n"
|
||||||
"wine_allow_resize=false\n"
|
|
||||||
"guard_lines=200\n"
|
"guard_lines=200\n"
|
||||||
"max_resolutions=0\n"
|
"max_resolutions=0\n"
|
||||||
"lock_surfaces=false\n"
|
"lock_surfaces=false\n"
|
||||||
|
4
src/dd.c
4
src/dd.c
@ -1093,12 +1093,12 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
|||||||
real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
|
real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_config.wine_allow_resize && IsWine())
|
if (IsLinux())
|
||||||
{
|
{
|
||||||
real_SetWindowLongA(
|
real_SetWindowLongA(
|
||||||
g_ddraw.hwnd,
|
g_ddraw.hwnd,
|
||||||
GWL_STYLE,
|
GWL_STYLE,
|
||||||
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(WS_MAXIMIZEBOX | WS_THICKFRAME));
|
(real_GetWindowLongA(g_ddraw.hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(WS_MAXIMIZEBOX));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* center the window with correct dimensions */
|
/* center the window with correct dimensions */
|
||||||
|
@ -443,12 +443,23 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
{
|
{
|
||||||
if (wParam == SIZE_RESTORED)
|
if (wParam == SIZE_RESTORED)
|
||||||
{
|
{
|
||||||
|
if (in_size_move && g_ddraw.render.thread && IsMacOS())
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&g_ddraw.cs);
|
||||||
|
g_ddraw.render.run = FALSE;
|
||||||
|
ReleaseSemaphore(g_ddraw.render.sem, 1, NULL);
|
||||||
|
LeaveCriticalSection(&g_ddraw.cs);
|
||||||
|
|
||||||
|
WaitForSingleObject(g_ddraw.render.thread, INFINITE);
|
||||||
|
g_ddraw.render.thread = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_size_move && !g_ddraw.render.thread)
|
if (in_size_move && !g_ddraw.render.thread)
|
||||||
{
|
{
|
||||||
g_config.window_rect.right = LOWORD(lParam);
|
g_config.window_rect.right = LOWORD(lParam);
|
||||||
g_config.window_rect.bottom = HIWORD(lParam);
|
g_config.window_rect.bottom = HIWORD(lParam);
|
||||||
}
|
}
|
||||||
else if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && g_config.wine_allow_resize && IsLinux())
|
else if (!in_size_move && g_ddraw.render.thread && !g_config.fullscreen && IsLinux())
|
||||||
{
|
{
|
||||||
g_config.window_rect.right = LOWORD(lParam);
|
g_config.window_rect.right = LOWORD(lParam);
|
||||||
g_config.window_rect.bottom = HIWORD(lParam);
|
g_config.window_rect.bottom = HIWORD(lParam);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user