mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 05:48:40 +00:00
fix nccalcsize in fullscreen mode
This commit is contained in:
@@ -647,18 +647,22 @@ 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);
|
||||||
RECT* rect = wParam == 0 ? (RECT*)lParam : ((NCCALCSIZE_PARAMS*)lParam)->rgrc;
|
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
|
||||||
rect->right -= frame_x + padding;
|
if(!is_fullscreen)
|
||||||
rect->left += frame_x + padding;
|
|
||||||
rect->bottom -= frame_y + padding;
|
|
||||||
|
|
||||||
if (IsMaximized(hwnd))
|
|
||||||
{
|
{
|
||||||
rect->top += frame_y + padding;
|
RECT* rect = wParam == 0 ? (RECT*)lParam : ((NCCALCSIZE_PARAMS*)lParam)->rgrc;
|
||||||
// If we do not do this hidden taskbar can not be unhidden on mouse hover
|
rect->right -= frame_x + padding;
|
||||||
// Unfortunately it can create an ugly bottom border when maximized...
|
rect->left += frame_x + padding;
|
||||||
rect->bottom -= 1;
|
rect->bottom -= frame_y + padding;
|
||||||
|
|
||||||
|
if(IsMaximized(hwnd))
|
||||||
|
{
|
||||||
|
rect->top += frame_y + padding;
|
||||||
|
// If we do not do this hidden taskbar can not be unhidden on mouse hover
|
||||||
|
// Unfortunately it can create an ugly bottom border when maximized...
|
||||||
|
rect->bottom -= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -704,7 +708,7 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
pos_monitor.y = GET_Y_LPARAM(lParam);
|
pos_monitor.y = GET_Y_LPARAM(lParam);
|
||||||
POINT pos_client = pos_monitor;
|
POINT pos_client = pos_monitor;
|
||||||
ScreenToClient(hwnd, &pos_client);
|
ScreenToClient(hwnd, &pos_client);
|
||||||
|
|
||||||
// Adjustments happening in NCCALCSIZE are messing with the detection
|
// Adjustments happening in NCCALCSIZE are messing with the detection
|
||||||
// of the top hit area so manually checking that.
|
// of the top hit area so manually checking that.
|
||||||
F32 dpi = w32_GetDpiForWindow_func ? (F32)w32_GetDpiForWindow_func(hwnd) : 96.f;
|
F32 dpi = w32_GetDpiForWindow_func ? (F32)w32_GetDpiForWindow_func(hwnd) : 96.f;
|
||||||
|
|||||||
Reference in New Issue
Block a user