Skip to content

Commit

Permalink
add new setting to enable (very bugged) resize in wine
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed May 24, 2024
1 parent 1d4403d commit c1a14a3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct CNCDDRAWCONFIG
BOOL direct3d_passthrough;
BOOL center_cursor_fix;
char fake_mode[128];
BOOL wine_allow_resize;

/* Hotkeys */

Expand Down
2 changes: 2 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void cfg_load()
GET_BOOL(g_config.direct3d_passthrough, "direct3d_passthrough", FALSE);
GET_BOOL(g_config.center_cursor_fix, "center_cursor_fix", FALSE);
GET_STRING("fake_mode", "", g_config.fake_mode, sizeof(g_config.fake_mode));
GET_BOOL(g_config.wine_allow_resize, "wine_allow_resize", FALSE);

/* Hotkeys */

Expand Down Expand Up @@ -303,6 +304,7 @@ static void cfg_create_ini()
"direct3d_passthrough=false\n"
"center_cursor_fix=false\n"
";fake_mode=640x480x32\n"
"wine_allow_resize=false\n"
"\n"
"\n"
"\n"
Expand Down
2 changes: 1 addition & 1 deletion src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
}

if (IsWine())
if (!g_config.wine_allow_resize && IsWine())
{
real_SetWindowLongA(
g_ddraw.hwnd,
Expand Down
13 changes: 6 additions & 7 deletions src/wndproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,14 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
g_config.window_rect.right = LOWORD(lParam);
g_config.window_rect.bottom = HIWORD(lParam);
}
/*
else if (g_ddraw.wine)
else if (!in_size_move && !g_config.fullscreen && g_config.wine_allow_resize && IsLinux())
{
WindowRect.right = LOWORD(lParam);
WindowRect.bottom = HIWORD(lParam);
if (WindowRect.right != g_ddraw.render.width || WindowRect.bottom != g_ddraw.render.height)
dd_SetDisplayMode(g_ddraw.width, g_ddraw.height, g_ddraw.bpp);
g_config.window_rect.right = LOWORD(lParam);
g_config.window_rect.bottom = HIWORD(lParam);

if (g_config.window_rect.right != g_ddraw.render.width || g_config.window_rect.bottom != g_ddraw.render.height)
dd_SetDisplayMode(g_ddraw.width, g_ddraw.height, g_ddraw.bpp, 0);
}
*/
}
}

Expand Down

0 comments on commit c1a14a3

Please sign in to comment.