mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Windowing: Avoid recursively calling WM_NCHITTEST in contains()
This commit is contained in:
parent
adbb0850ed
commit
515e9b9f89
1 changed files with 16 additions and 2 deletions
|
|
@ -1782,8 +1782,22 @@ public:
|
|||
if (! r.withZeroOrigin().contains (localPos))
|
||||
return false;
|
||||
|
||||
auto w = WindowFromPoint (D2DUtilities::toPOINT (convertLogicalScreenPointToPhysical (localPos + getScreenPosition(),
|
||||
hwnd)));
|
||||
const auto screenPos = convertLogicalScreenPointToPhysical (localPos + getScreenPosition(), hwnd);
|
||||
|
||||
if (trueIfInAChildWindow)
|
||||
{
|
||||
// Quick check to see whether the point is inside the client bounds
|
||||
RECT rect;
|
||||
GetClientRect (hwnd, &rect);
|
||||
POINT points[2];
|
||||
memcpy (points, &rect, sizeof (points));
|
||||
MapWindowPoints (hwnd, nullptr, points, (UINT) std::size (points));
|
||||
memcpy (&rect, points, sizeof (points));
|
||||
|
||||
return PtInRect (&rect, D2DUtilities::toPOINT (screenPos));
|
||||
}
|
||||
|
||||
auto w = WindowFromPoint (D2DUtilities::toPOINT (screenPos));
|
||||
|
||||
return w == hwnd || (trueIfInAChildWindow && (IsChild (hwnd, w) != 0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue