Skip to content

Commit

Permalink
Issue #3 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Meragon committed Sep 2, 2016
1 parent a3b31b1 commit 505b347
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions System/Windows/Forms/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ private bool _IsHovered(Control control, System.Drawing.Point mousePosition)
var mouseToClient = control.PointToClient(mousePosition);
var controlForm = GetRootControl(control) as Form;
if (control.Context || (controlForm != null && controlForm == _FormAt(mousePosition)))
{
if (control.Context == false)
{
for (int i = 0; i < Contexts.Count; i++)
{
var contextControl = Contexts[i];
var contextRect = new System.Drawing.Rectangle(contextControl.Location.X, contextControl.Location.Y, contextControl.Width, contextControl.Height);
if (contextRect.Contains(mousePosition))
return false;
}
}
if (control.ClientRectangle.Contains(mouseToClient))
{
if (control.mouseEntered == false)
Expand All @@ -140,6 +151,7 @@ private bool _IsHovered(Control control, System.Drawing.Point mousePosition)
control.RaiseOnMouseHover(new MouseEventArgs(MouseButtons.None, 0, mouseToClient.X, mouseToClient.Y, 0));
return true;
}
}

return false;
}
Expand Down

0 comments on commit 505b347

Please sign in to comment.