Skip to content

Commit

Permalink
Revert "Fix crash from alt-tab'ing just after startup (#102453)" (#10…
Browse files Browse the repository at this point in the history
…3074)

This reverts commit 74e9a6d.
  • Loading branch information
darrenaustin committed May 4, 2022
1 parent 74e9a6d commit 3c9f417
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 1 addition & 2 deletions packages/flutter/lib/src/rendering/mouse_tracker.dart
Expand Up @@ -319,8 +319,7 @@ class MouseTracker extends ChangeNotifier {
// so that [mouseIsConnected], which is decided by `_mouseStates`, is
// correct during the callbacks.
if (existingState == null) {
if (event is PointerRemovedEvent)
return;
assert(event is! PointerRemovedEvent);
_mouseStates[device] = _MouseState(initialEvent: event);
} else {
assert(event is! PointerAddedEvent);
Expand Down
10 changes: 0 additions & 10 deletions packages/flutter/test/rendering/mouse_tracker_test.dart
Expand Up @@ -133,16 +133,6 @@ void main() {
listenerLogs.clear();
});

// Regression test for https://github.com/flutter/flutter/issues/90838
test('should not crash if the first event is a Removed event', () {
final List<PointerEvent> events = <PointerEvent>[];
_setUpWithOneAnnotation(logEvents: events);
ui.window.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[
_pointerData(PointerChange.remove, Offset.zero),
]));
events.clear();
});

test('should correctly handle multiple devices', () {
final List<PointerEvent> events = <PointerEvent>[];
setUpWithOneAnnotation(logEvents: events);
Expand Down

0 comments on commit 3c9f417

Please sign in to comment.