From 68f7837a755c9bda23451c3f040b1c38f72002a6 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Tue, 25 Jul 2023 11:55:44 +0900 Subject: [PATCH] [NUI] Restore FeedHover due to api compatibility issue. And the null check is done in FeedHover. revert : https://github.com/Samsung/TizenFX/pull/5411 --- src/Tizen.NUI/src/public/Window/Window.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index af07740..4854286 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -1168,13 +1168,7 @@ namespace Tizen.NUI internalHoverTimer = new Timer(time); internalHoverTimer.Tick += (s, e) => { - 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); - } + FeedHover(); internalHoverTimer?.Stop(); internalHoverTimer?.Dispose(); internalHoverTimer = null; @@ -1212,10 +1206,20 @@ namespace Tizen.NUI /// /// Feeds a hover event into the window. /// - /// The touch point to feed hover event. + /// The touch point to feed hover event. If null is entered, the feed hover event is generated with the last inputed touch point. [EditorBrowsable(EditorBrowsableState.Never)] - internal void FeedHover(TouchPoint touchPoint) + internal void FeedHover(TouchPoint touchPoint = null) { + if (touchPoint == null) + { + using Touch touch = GetLastTouchEvent(); + if (touch == null || touch.GetPointCount() < 1) + { + return; + } + 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