Skip to content

Missing support for .stationary touches #51

Open
@OdNairy

Description

@OdNairy

Describe the bug
After two finger downs it is not possible to up single finger – both touches are ending

To Reproduce
Code to reproduce:

    func testBug() throws {
        try eventGenerator.wait(1)
        try eventGenerator.fingerDown([.rightThumb, .rightIndex],
                                      at: [
                                        CGPoint(x: 200, y: 400),
                                        CGPoint(x: 400, y: 400)
                                      ])
        try eventGenerator.wait(1)
        try eventGenerator.fingerUp([.rightThumb])
        try eventGenerator.wait(3)
        try eventGenerator.fingerUp([.rightIndex])
        try eventGenerator.wait(3)
    }

Expected behavior
Single finger released allowing to manipulate the second one.
I have a scenario where I do zooming then release one finger and starting to pan the map view.

Screenshots
If applicable, add screenshots to help explain your problem.
There is an extra framework to visualise touches with handling phases and locations via UIApplication.sendEvent. Circle animation starts when touch in the Ended phase was received.

hammer_two_fingers_one_release_bug.mov

Environment (please complete the following information):

  • Devices: iPhone 14 Pro, iPad mini 5
    • Simulator: iPad mini 6
  • OS: iOS 16.3.1
  • Xcode: 14.2

Additional context
UIApplication.sendEvent receives two UITouch events with the Ended phase.
Add any other context about the problem here.

Full UIApplication.sendEvent events report from sample code
Test Case '-[DebugAppTests.DebugAppTests testBug]' started (Iteration 1 of 3).
<UITouchesEvent: 0x60000331a490> timestamp: 178537 touches: {(
    <UITouch: 0x1288461a0> phase: Began tap count: 1 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: (null) ,
    <UITouch: 0x128838560> phase: Began tap count: 1 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: <MTKView: 0x12981e400; frame = (0 0; 1133 744); layer = <CAMetalLayer: 0x600000666e80>> location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

2023-02-15 13:41:11.608328+0200 DebugApp[69948:3352821] [Window] Manually adding the rootViewController's view to the view hierarchy is no longer supported. Please allow UIWindow to add the rootViewController's view to the view hierarchy itself.
<UITouchesEvent: 0x60000331a490> timestamp: 178537 touches: {(
    <UITouch: 0x1288461a0> phase: Began tap count: 1 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: (null) ,
    <UITouch: 0x128838560> phase: Began tap count: 1 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: <MTKView: 0x12981e400; frame = (0 0; 1133 744); layer = <CAMetalLayer: 0x600000666e80>> location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

2023-02-15 13:41:11.707522+0200 DebugApp[69948:3352821] [EventDispatcher] Found no UIEvent for backing event of type: 1; contextId: 0x91D53B81
<UITouchesEvent: 0x60000331a490> timestamp: 178538 touches: {(
    <UITouch: 0x1288461a0> phase: Ended tap count: 0 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: (null) ,
    <UITouch: 0x128838560> phase: Ended tap count: 0 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: <MTKView: 0x12981e400; frame = (0 0; 1133 744); layer = <CAMetalLayer: 0x600000666e80>> location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

<UITouchesEvent: 0x60000331a490> timestamp: 178538 touches: {(
    <UITouch: 0x1288461a0> phase: Ended tap count: 0 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: (null) ,
    <UITouch: 0x128838560> phase: Ended tap count: 0 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: <MTKView: 0x12981e400; frame = (0 0; 1133 744); layer = <CAMetalLayer: 0x600000666e80>> location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

2023-02-15 13:41:12.907412+0200 DebugApp[69948:3352821] [EventDispatcher] Found no UIEvent for backing event of type: 1; contextId: 0x91D53B81

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions