Repository: flutter
Issue: Native macOS context menus can cause Flutter to miss tapUp events (and freeze rendering).
Labels: platform-mac,a: desktop,has reproducible steps,P2,found in release: 3.10,found in release: 3.13,team-macos,triaged-macos

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

Default behavior on macOS is to open context menus on a tapDown event (to be able to drag the mouse to the corresponding item and select it without clicking twice). Hence the instructions:

1. Click "Do Nothing" and observe desired console output "tap down" -> "tap up"
2. Click on "Open Context Menu" and select an item from the menu with the mouse. Alternatively, click on the button and drag the mouse without lifting the mouse button to the correct item and let go. Observe console output while doing so. Notice that the "tap up" event is missing and that the next click has no effect.
3. Long press on "Long Press to Open Context Menu" until the context menu appears. Observe how the Inkwell animation gets stuck while the context menu is displayed.

### Expected results

1. All "tap down" events are accompanied by corresponding "tap up" events.
2. No tap events are ignored.
3. Rendering continues even while a context menu is open.

### Actual results

1. "tap up" events are missing if context menu is opened on "tap down" event and an item is selected from the context menu via the mouse.
2. If a "tap up" event is missing, the next "tap down" event has no effect.
3. Rendering is paused while a context menu is open (though, this might be a design decision by Apple which Flutter cannot do anything about..hence not a separate issue for this).

### Code sample

<details><summary>Code sample</summary>

https://github.com/KevinBrendel/flutter_context_menu_key_event

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/55455206/defbd5b1-08ba-43d7-ac6d-be11f158fed1

</details>


### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64, locale en-US)
    • Flutter version 3.10.6 on channel stable at /Users/kevin/SDKs/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (6 days ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/kevin/Library/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.80.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.68.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.4.1 22F770820d darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>