Skip to content

Commit

Permalink
fix(dragdrop): Fix drag and drop support on skia
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Dec 16, 2021
1 parent 00fc1e3 commit bf7e473
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/UIElement.Pointers.Managed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private static void RaiseUsingCaptures(RaisePointerEventArgs raise, UIElement or
}
else
{
var explicitTarget = targets.Find(c => c.Kind == PointerCaptureKind.Explicit)!;
var explicitTarget = targets.Find(c => c.Kind.HasFlag(PointerCaptureKind.Explicit))!;

raise(explicitTarget.Element, routedArgs, BubblingContext.Bubble);

Expand Down
8 changes: 4 additions & 4 deletions src/Uno.UI/UI/Xaml/UIElement.Pointers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ internal HitTestability GetHitTestVisibility()
var that = (UIElement)sender.Owner;
that.OnDragStarting(args);
};
#endregion
#endregion

private GestureRecognizer CreateGestureRecognizer()
{
Expand Down Expand Up @@ -395,7 +395,7 @@ private async void HapticFeedbackWhenReadyToDrag(GestureRecognizer sender, Gestu
this.Log().Error("Haptic feedback for drag failed", error);
}
}
#endregion
#endregion

#region Manipulations (recognizer settings / custom bubbling)
partial void AddManipulationHandler(RoutedEvent routedEvent, int handlersCount, object handler, bool handledEventsToo)
Expand Down Expand Up @@ -452,7 +452,7 @@ private void UpdateManipulations(ManipulationModes mode, bool hasManipulationHan
}
// Note: We do not need to alter the location of the events, on UWP they are always relative to the OriginalSource.
}
#endregion
#endregion

#region Gestures (recognizer settings / custom bubbling / early completion)
private bool _isGestureCompleted;
Expand Down Expand Up @@ -905,7 +905,7 @@ private bool OnPointerUp(PointerRoutedEventArgs args, BubblingContext ctx = defa
// so we should not use them for gesture recognition.
var isDragging = _gestures.Value.IsDragging;
_gestures.Value.ProcessUpEvent(args.GetCurrentPoint(this), !ctx.IsInternal || isOverOrCaptured);
if (isDragging)
if (isDragging && !ctx.IsInternal)
{
global::Windows.UI.Xaml.Window.Current.DragDrop.ProcessDropped(args);
}
Expand Down

0 comments on commit bf7e473

Please sign in to comment.