1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

#305 add support for window menu in borderless mode

This commit is contained in:
FunkyFr3sh 2024-04-20 00:34:46 +02:00
parent 547fda273a
commit f735ef839c

View File

@ -632,6 +632,11 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
{ {
border = FALSE; border = FALSE;
if (!g_config.remove_menu && GetMenu(g_ddraw.hwnd))
{
g_ddraw.render.height -= real_GetSystemMetrics(SM_CYMENU);
}
/* prevent OpenGL from going automatically into fullscreen exclusive mode */ /* prevent OpenGL from going automatically into fullscreen exclusive mode */
if (g_ddraw.renderer == ogl_render_main) if (g_ddraw.renderer == ogl_render_main)
nonexclusive = TRUE; nonexclusive = TRUE;
@ -882,10 +887,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
GWL_STYLE, GWL_STYLE,
real_GetWindowLongA( real_GetWindowLongA(
g_ddraw.hwnd, g_ddraw.hwnd,
GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU)); GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
if (GetMenu(g_ddraw.hwnd))
SetMenu(g_ddraw.hwnd, NULL);
} }
else else
{ {
@ -919,6 +921,11 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
if (g_config.fullscreen) if (g_config.fullscreen)
{ {
x = y = 0; x = y = 0;
if (!g_config.remove_menu && GetMenu(g_ddraw.hwnd))
{
y = real_GetSystemMetrics(SM_CYMENU);
}
} }
else if (border && g_config.window_rect.top == -32000 && y < 0) else if (border && g_config.window_rect.top == -32000 && y < 0)
{ {