浏览代码

Fixes #2014. Application mouseGrabView is run twice if return true. (#2015)

* Fixes #2014. Application mouseGrabView is run twice if return true.

* Sometimes I get fails with this unit test.
BDisp 2 年之前
父节点
当前提交
f57e48b1e5
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      Terminal.Gui/Core/Application.cs

+ 2 - 5
Terminal.Gui/Core/Application.cs

@@ -656,11 +656,8 @@ namespace Terminal.Gui {
 					lastMouseOwnerView?.OnMouseLeave (me);
 				}
 				// System.Diagnostics.Debug.WriteLine ($"{nme.Flags};{nme.X};{nme.Y};{mouseGrabView}");
-				if (mouseGrabView != null) {
-					mouseGrabView.OnMouseEvent (nme);
-					if (mouseGrabView != null) {
-						return;
-					}
+				if (mouseGrabView != null && mouseGrabView.OnMouseEvent (nme)) {
+					return;
 				}
 			}