fix nccalcsize in fullscreen mode

This commit is contained in:
Ryan Fleury
2024-12-16 10:59:35 -08:00
parent 2a72f525fb
commit ac54281062
+6 -2
View File
@@ -647,13 +647,16 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
S32 frame_x = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CXFRAME, dpi) : GetSystemMetrics(SM_CXFRAME); S32 frame_x = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CXFRAME, dpi) : GetSystemMetrics(SM_CXFRAME);
S32 frame_y = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CYFRAME, dpi) : GetSystemMetrics(SM_CYFRAME); S32 frame_y = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CYFRAME, dpi) : GetSystemMetrics(SM_CYFRAME);
S32 padding = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CXPADDEDBORDER, dpi) : GetSystemMetrics(SM_CXPADDEDBORDER); S32 padding = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CXPADDEDBORDER, dpi) : GetSystemMetrics(SM_CXPADDEDBORDER);
DWORD window_style = GetWindowLong(hwnd, GWL_STYLE);
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
if(!is_fullscreen)
{
RECT* rect = wParam == 0 ? (RECT*)lParam : ((NCCALCSIZE_PARAMS*)lParam)->rgrc; RECT* rect = wParam == 0 ? (RECT*)lParam : ((NCCALCSIZE_PARAMS*)lParam)->rgrc;
rect->right -= frame_x + padding; rect->right -= frame_x + padding;
rect->left += frame_x + padding; rect->left += frame_x + padding;
rect->bottom -= frame_y + padding; rect->bottom -= frame_y + padding;
if (IsMaximized(hwnd)) if(IsMaximized(hwnd))
{ {
rect->top += frame_y + padding; rect->top += frame_y + padding;
// If we do not do this hidden taskbar can not be unhidden on mouse hover // If we do not do this hidden taskbar can not be unhidden on mouse hover
@@ -661,6 +664,7 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
rect->bottom -= 1; rect->bottom -= 1;
} }
} }
}
else else
{ {
result = DefWindowProc(hwnd, uMsg, wParam, lParam); result = DefWindowProc(hwnd, uMsg, wParam, lParam);