From ece414c575d6e2b9eb0cbdf21ec30390ed29f5ba Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 23 May 2024 14:40:23 -0700 Subject: [PATCH] prioritize title-bar-client-areas over built-in window borders; expand top bar rect a bit to ensure edge of window coverage --- src/df/gfx/df_gfx.c | 4 ++-- src/os/gfx/win32/os_gfx_win32.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index ee64236b..ad18002a 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3308,7 +3308,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // Rng2F32 window_rect = os_client_rect_from_window(ws->os); Vec2F32 window_rect_dim = dim_2f32(window_rect); - Rng2F32 top_bar_rect = r2f32p(window_rect.x0, window_rect.y0, window_rect.x0+window_rect_dim.x, window_rect.y0+ui_top_pref_height().value); + Rng2F32 top_bar_rect = r2f32p(window_rect.x0, window_rect.y0, window_rect.x0+window_rect_dim.x+1, window_rect.y0+ui_top_pref_height().value); Rng2F32 bottom_bar_rect = r2f32p(window_rect.x0, window_rect_dim.y - ui_top_pref_height().value, window_rect.x0+window_rect_dim.x, window_rect.y0+window_rect_dim.y); Rng2F32 content_rect = r2f32p(window_rect.x0, top_bar_rect.y1, window_rect.x0+window_rect_dim.x, bottom_bar_rect.y0); F32 window_edge_px = os_dpi_from_window(ws->os)*0.035f; @@ -5302,7 +5302,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } os_window_push_custom_title_bar_client_area(ws->os, min_sig.box->rect); os_window_push_custom_title_bar_client_area(ws->os, max_sig.box->rect); - os_window_push_custom_title_bar_client_area(ws->os, cls_sig.box->rect); + os_window_push_custom_title_bar_client_area(ws->os, pad_2f32(cls_sig.box->rect, 2.f)); } } } diff --git a/src/os/gfx/win32/os_gfx_win32.c b/src/os/gfx/win32/os_gfx_win32.c index e94e07df..f10e93ac 100644 --- a/src/os/gfx/win32/os_gfx_win32.c +++ b/src/os/gfx/win32/os_gfx_win32.c @@ -771,12 +771,6 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) result = HTCAPTION; } - // rjf: title bar client area - if(is_over_title_bar_client_area) - { - result = HTCLIENT; - } - // rjf: normal edges if(is_over_left) { result = HTLEFT; } if(is_over_right) { result = HTRIGHT; } @@ -788,6 +782,12 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if(is_over_left && is_over_bottom) { result = HTBOTTOMLEFT; } if(is_over_right && is_over_top) { result = HTTOPRIGHT; } if(is_over_right && is_over_bottom) { result = HTBOTTOMRIGHT; } + + // rjf: title bar client area + if(is_over_title_bar_client_area) + { + result = HTCLIENT; + } } } }break;