Skip to content

Commit

Permalink
[NUI] Restore FeedHover due to api compatibility issue.
Browse files Browse the repository at this point in the history
And the null check is done in FeedHover.

revert : Samsung#5411
  • Loading branch information
JoogabYun authored and hinohie committed Jul 25, 2023
1 parent b207a1f commit 68f7837
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/Tizen.NUI/src/public/Window/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1168,13 +1168,7 @@ public void LazyFeedHover(uint time = 48)
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;
Expand Down Expand Up @@ -1212,10 +1206,20 @@ internal void FeedWheel(Wheel wheelEvent)
/// <summary>
/// Feeds a hover event into the window.
/// </summary>
/// <param name="touchPoint">The touch point to feed hover event.</param>
/// <param name="touchPoint">The touch point to feed hover event. If null is entered, the feed hover event is generated with the last inputed touch point.</param>
[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();
}
Expand Down

0 comments on commit 68f7837

Please sign in to comment.