Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 30 additions & 27 deletions appshell/cef_dark_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,40 +768,43 @@ int cef_dark_window::HandleNcHitTest(LPPOINT ptHit)
if (::PtInRect(&rectSysIcon, *ptHit))
return HTSYSMENU;

// Left Border
if (ptHit->x >= rectWindow.left && ptHit->x <= rectWindow.left + ::GetSystemMetrics (SM_CYFRAME))
{
// it's important that we know if the mouse is on a corner so that
// the right mouse cursor is displayed
if (ptHit->y <= rectWindow.top + ::GetSystemMetrics (SM_CYFRAME))
return HTTOPLEFT;
if (!IsZoomed()) {

// Left Border
if (ptHit->x >= rectWindow.left && ptHit->x <= rectWindow.left + ::GetSystemMetrics (SM_CYFRAME))
{
// it's important that we know if the mouse is on a corner so that
// the right mouse cursor is displayed
if (ptHit->y <= rectWindow.top + ::GetSystemMetrics (SM_CYFRAME))
return HTTOPLEFT;

if (ptHit->y >= rectWindow.bottom - ::GetSystemMetrics (SM_CYFRAME))
return HTBOTTOMLEFT;
if (ptHit->y >= rectWindow.bottom - ::GetSystemMetrics (SM_CYFRAME))
return HTBOTTOMLEFT;

return HTLEFT;
}
return HTLEFT;
}

// Right Border
if (ptHit->x <= rectWindow.right && ptHit->x >= rectWindow.right - ::GetSystemMetrics (SM_CYFRAME))
{
// it's important that we know if the mouse is on a corner so that
// the right mouse cursor is displayed
if (ptHit->y <= rectWindow.top + ::GetSystemMetrics (SM_CYFRAME))
return HTTOPRIGHT;
// Right Border
if (ptHit->x <= rectWindow.right && ptHit->x >= rectWindow.right - ::GetSystemMetrics (SM_CYFRAME))
{
// it's important that we know if the mouse is on a corner so that
// the right mouse cursor is displayed
if (ptHit->y <= rectWindow.top + ::GetSystemMetrics (SM_CYFRAME))
return HTTOPRIGHT;

if (ptHit->y >= rectWindow.bottom - ::GetSystemMetrics (SM_CYFRAME))
return HTBOTTOMRIGHT;
if (ptHit->y >= rectWindow.bottom - ::GetSystemMetrics (SM_CYFRAME))
return HTBOTTOMRIGHT;

return HTRIGHT;
}
return HTRIGHT;
}

// Top and Bottom Borders
if (ptHit->y <= rectWindow.top + ::GetSystemMetrics (SM_CYFRAME))
return HTTOP;
// Top and Bottom Borders
if (ptHit->y <= rectWindow.top + ::GetSystemMetrics (SM_CYFRAME))
return HTTOP;

if (ptHit->y >= rectWindow.bottom - ::GetSystemMetrics (SM_CYFRAME))
return HTBOTTOM;
if (ptHit->y >= rectWindow.bottom - ::GetSystemMetrics (SM_CYFRAME))
return HTBOTTOM;
}

// If it's not in the menu, it's in the caption
RECT rectMenu;
Expand Down