diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-30 13:18:21 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-09-01 12:44:39 +0200 |
| commit | e68f66a334bd37c60416615d8314a62dd9d05740 (patch) | |
| tree | e5470014265563fd480427fe841013834668e405 /src/Interface.cs | |
| parent | 8e0a800f3fdec3ce0815ac797f365837eec67d30 (diff) | |
debug mouse focus
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 5ad638b4..73f44a6a 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -572,7 +572,8 @@ namespace Crow int i = 0; while (i < idxhw) { if (GraphicTree [i].MouseIsIn (e.Position)) { - HoverWidget.onMouseLeave (HoverWidget, e); + //set evtarg to null to force mouseLeave without checking mouse pos + HoverWidget.onMouseLeave (HoverWidget, null); GraphicTree [i].checkHoverWidget (e); return true; } @@ -586,26 +587,21 @@ namespace Crow return true; } else { HoverWidget.onMouseLeave (HoverWidget, e); - //seek upward from last focused graph obj's - while (HoverWidget.Parent as GraphicObject != null) { - HoverWidget = HoverWidget.Parent as GraphicObject; - if (HoverWidget.MouseIsIn (e.Position)) { - HoverWidget.checkHoverWidget (e); - return true; - } else - HoverWidget.onMouseLeave (HoverWidget, e); - } + if (HoverWidget != null) + return true; } } //top level graphic obj's parsing - for (int i = 0; i < GraphicTree.Count; i++) { - GraphicObject g = GraphicTree[i]; - if (g.MouseIsIn (e.Position)) { - g.checkHoverWidget (e); - if (g is Window) - PutOnTop (g); - return true; + lock (GraphicTree) { + for (int i = 0; i < GraphicTree.Count; i++) { + GraphicObject g = GraphicTree [i]; + if (g.MouseIsIn (e.Position)) { + g.checkHoverWidget (e); + if (g is Window) + PutOnTop (g); + return true; + } } } HoverWidget = null; |