From 3c9f417326fa0d9ce296465fb0b213958927cee3 Mon Sep 17 00:00:00 2001 From: Darren Austin Date: Wed, 4 May 2022 12:13:02 -0700 Subject: [PATCH] Revert "Fix crash from alt-tab'ing just after startup (#102453)" (#103074) This reverts commit 74e9a6d9cd8a26287b14b88790a104ea41f9de65. --- packages/flutter/lib/src/rendering/mouse_tracker.dart | 3 +-- .../flutter/test/rendering/mouse_tracker_test.dart | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/flutter/lib/src/rendering/mouse_tracker.dart b/packages/flutter/lib/src/rendering/mouse_tracker.dart index b83d332301d8..0e2234107ee7 100644 --- a/packages/flutter/lib/src/rendering/mouse_tracker.dart +++ b/packages/flutter/lib/src/rendering/mouse_tracker.dart @@ -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); diff --git a/packages/flutter/test/rendering/mouse_tracker_test.dart b/packages/flutter/test/rendering/mouse_tracker_test.dart index 2290bb787846..9ddae1e9505d 100644 --- a/packages/flutter/test/rendering/mouse_tracker_test.dart +++ b/packages/flutter/test/rendering/mouse_tracker_test.dart @@ -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 events = []; - _setUpWithOneAnnotation(logEvents: events); - ui.window.onPointerDataPacket!(ui.PointerDataPacket(data: [ - _pointerData(PointerChange.remove, Offset.zero), - ])); - events.clear(); - }); - test('should correctly handle multiple devices', () { final List events = []; setUpWithOneAnnotation(logEvents: events);