Skip to content

Commit

Permalink
Skip custom titlebar hit testing if a modal is visible
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Jan 31, 2024
1 parent d148ccc commit a9d2972
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/devue_core/src/graphics/dv_opengl_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,16 @@ intptr_t dv_opengl_window::wndproc_callback(dv_opengl_window* wnd, handle_t hand
break;
}
case WM_NCHITTEST: {
POINTS mouse_pos = MAKEPOINTS(lparam);
POINT client_mouse_pos = { mouse_pos.x, mouse_pos.y };
POINTS mouse_pos = MAKEPOINTS(lparam);
POINT client_mouse_pos = { mouse_pos.x, mouse_pos.y };
ImGuiWindow* modal = ImGui::GetTopMostAndVisiblePopupModal();

ScreenToClient(hwnd, &client_mouse_pos);

if (wnd->m_hover_maximize)
return HTMAXBUTTON;

if (!wnd->m_skip_titlebar_hit && client_mouse_pos.y > 0 && client_mouse_pos.y <= wnd->m_custom_titlebar_height)
if (!wnd->m_skip_titlebar_hit && !modal && client_mouse_pos.y > 0 && client_mouse_pos.y <= wnd->m_custom_titlebar_height)
return HTCAPTION;

break;
Expand Down

0 comments on commit a9d2972

Please sign in to comment.