From 64b2dfa3aaa514407e4a21c50dd31e4db3515aea Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Tue, 28 Mar 2023 11:11:06 +0900 Subject: [PATCH] [NUI] Register HitTest callback only if GrabTouchAfterLeave = true Since useless HitTest checkup function make performance down for standard cases, Let we make we use custom callback only if GrabTouchAfterLeave case. Signed-off-by: Eunki, Hong --- src/Tizen.NUI/src/public/BaseComponents/View.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 9cb082e..3cc633e 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -209,9 +209,6 @@ namespace Tizen.NUI.BaseComponents PositionUsesPivotPoint = false; GrabTouchAfterLeave = defaultGrabTouchAfterLeave; AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch; - - // TODO : Can we call this function only for required subclass? - RegisterHitTestCallback(); } if (!shown) @@ -3237,6 +3234,17 @@ namespace Tizen.NUI.BaseComponents set { Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value); + + // Use custom HitTest callback only if GrabTouchAfterLeave is true. + if (value) + { + RegisterHitTestCallback(); + } + else + { + UnregisterHitTestCallback(); + } + NotifyPropertyChanged(); } } -- 2.7.4