From b207a1fdc13c971822ee73f7f37c02919a4ead5d Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Tue, 25 Jul 2023 11:01:16 +0900 Subject: [PATCH] [NUI] Add logic to check if GetLastTouchEvent() is null. --- src/Tizen.NUI/src/public/Window/Window.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index ccfa9c3..af07740 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -1168,7 +1168,13 @@ namespace Tizen.NUI internalHoverTimer = new Timer(time); internalHoverTimer.Tick += (s, e) => { - FeedHover(); + using Touch touch = GetLastTouchEvent(); + if(touch != null && touch.GetPointCount() > 0) + { + using Vector2 screenPosition = touch.GetScreenPosition(0); + using TouchPoint touchPoint = new TouchPoint(touch.GetDeviceId(0), TouchPoint.StateType.Motion, screenPosition.X, screenPosition.Y); + FeedHover(touchPoint); + } internalHoverTimer?.Stop(); internalHoverTimer?.Dispose(); internalHoverTimer = null; @@ -1206,16 +1212,10 @@ namespace Tizen.NUI /// /// Feeds a hover event into the window. /// - /// The touch point to feed hover event. If null is entered, the feed hover event is generated with the last inputed touch point. + /// The touch point to feed hover event. [EditorBrowsable(EditorBrowsableState.Never)] - internal void FeedHover(TouchPoint touchPoint = null) + internal void FeedHover(TouchPoint touchPoint) { - if (touchPoint == null) - { - using Touch touch = GetLastTouchEvent(); - using Vector2 screenPosition = touch.GetScreenPosition(0); - touchPoint = new TouchPoint(touch.GetDeviceId(0), TouchPoint.StateType.Motion, screenPosition.X, screenPosition.Y); - } Interop.Window.FeedHoverEvent(SwigCPtr, TouchPoint.getCPtr(touchPoint)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } -- 2.7.4