@@ -794,6 +794,7 @@ protected virtual bool HandleMouseTouchStateChange(TouchStateChangeEvent e)
794
794
if ( ! MapMouseToLatestTouch )
795
795
return false ;
796
796
797
+ // Update mouse position state
797
798
if ( e . IsActive == true || e . LastPosition != null )
798
799
{
799
800
new MousePositionAbsoluteInputFromTouch ( e )
@@ -802,6 +803,7 @@ protected virtual bool HandleMouseTouchStateChange(TouchStateChangeEvent e)
802
803
} . Apply ( CurrentState , this ) ;
803
804
}
804
805
806
+ // Update mouse button state
805
807
if ( e . IsActive != null )
806
808
{
807
809
if ( e . IsActive == true )
@@ -812,6 +814,11 @@ protected virtual bool HandleMouseTouchStateChange(TouchStateChangeEvent e)
812
814
updateTouchMouseLeft ( e ) ;
813
815
}
814
816
817
+ // Invalidate mouse position if releasing last touch. This is done after updating button state
818
+ // for click events to be processed on the targeted input queue before the position is invalidated.
819
+ if ( e . IsActive == false && ! e . State . Touch . ActiveSources . HasAnyButtonPressed )
820
+ new MouseInvalidatePositionInputFromTouch ( e ) . Apply ( CurrentState , this ) ;
821
+
815
822
updateTouchMouseRight ( e ) ;
816
823
return true ;
817
824
}
@@ -827,6 +834,7 @@ private void updateTouchMouseLeft(TouchStateChangeEvent e)
827
834
private void updateTouchMouseRight ( TouchStateChangeEvent e )
828
835
{
829
836
if ( ! AllowRightClickFromLongTouch )
837
+ // fix this thing, make it cancel touch.
830
838
return ;
831
839
832
840
// if a touch was pressed/released in this event, reset gesture validity state.
0 commit comments