@@ -262,7 +262,7 @@ public virtual bool UpdateInput()
262262 public virtual void UpdateResolution ( )
263263 {
264264 setScaling ( ) ;
265- TouchManager . Instance . CancelPointer ( mousePointer . Id ) ;
265+ if ( mousePointer != null ) TouchManager . Instance . CancelPointer ( mousePointer . Id ) ;
266266 }
267267
268268 /// <inheritdoc />
@@ -500,24 +500,27 @@ private void nativePointer(int id, PointerEvent evt, PointerType type, Vector2 p
500500 }
501501 break ;
502502 case PointerType . Touch :
503+ TouchPointer touchPointer ;
503504 switch ( evt )
504505 {
505- // Enter/Leave logic is handles in Down/Up
506506 case PointerEvent . Enter :
507+ break ;
507508 case PointerEvent . Leave :
509+ // Sometimes Windows might not send Up, so have to execute touch release logic here.
510+ // Has been working fine on test devices so far.
511+ if ( winTouchToInternalId . TryGetValue ( id , out touchPointer ) )
512+ {
513+ winTouchToInternalId . Remove ( id ) ;
514+ internalRemoveTouchPointer ( touchPointer ) ;
515+ }
508516 break ;
509517 case PointerEvent . Down :
510- TouchPointer touchPointer = internalAddTouchPointer ( position ) ;
518+ touchPointer = internalAddTouchPointer ( position ) ;
511519 touchPointer . Rotation = getTouchRotation ( ref data ) ;
512520 touchPointer . Pressure = getTouchPressure ( ref data ) ;
513521 winTouchToInternalId . Add ( id , touchPointer ) ;
514522 break ;
515523 case PointerEvent . Up :
516- if ( winTouchToInternalId . TryGetValue ( id , out touchPointer ) )
517- {
518- winTouchToInternalId . Remove ( id ) ;
519- internalRemoveTouchPointer ( touchPointer ) ;
520- }
521524 break ;
522525 case PointerEvent . Update :
523526 if ( ! winTouchToInternalId . TryGetValue ( id , out touchPointer ) ) return ;
0 commit comments