From f57e48b1e5f3ef5288d2b2fbea5a2d93cb49583a Mon Sep 17 00:00:00 2001 From: BDisp Date: Fri, 16 Sep 2022 14:37:17 +0000 Subject: [PATCH] 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. --- Terminal.Gui/Core/Application.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Terminal.Gui/Core/Application.cs b/Terminal.Gui/Core/Application.cs index 2632c69be..eb1200999 100644 --- a/Terminal.Gui/Core/Application.cs +++ b/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; } }