From b192a52072812804f88b4dd1cb75dec418f025af Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Sun, 25 Aug 2024 08:00:36 -0700 Subject: [PATCH] [macOS] Add TODOs to remove AppKit bug workaround (#54764) In https://github.com/flutter/engine/pull/40241, I added a workaround for an AppKit bug wherein mouseDown/Up events were ignored when the *Reduced Transparency* accessibility setting was enabled, and the view was hosted in an `NSPopover`. I filed a Radar and Apple reported the bug fixed in macOS 13.3.1. When we drop support for macOS 12 in Flutter, we should remove the workaround. So long as nothing else has been added to these methods at that time, the method overrides themselves should be removed, so that we fall back to the default behaviour. See: http://www.openradar.me/FB12050037 See: https://developer.apple.com/documentation/appkit/nsresponder/1535349-mouseup Issue: https://github.com/flutter/flutter/issues/154063 Issue: https://github.com/flutter/flutter/issues/115015 No tests modified since this only adds a comment. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../darwin/macos/framework/Source/FlutterViewController.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm b/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm index 98a10e734ae83..1af5c9b1a5ea9 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm @@ -297,6 +297,9 @@ - (void)mouseDown:(NSEvent*)event { // See: https://github.com/flutter/flutter/issues/115015 // See: http://www.openradar.me/FB12050037 // See: https://developer.apple.com/documentation/appkit/nsresponder/1524634-mousedown + // + // TODO(cbracken): https://github.com/flutter/flutter/issues/154063 + // Remove this workaround when we drop support for macOS 12 (Monterey). [self.nextResponder mouseDown:event]; } @@ -311,6 +314,9 @@ - (void)mouseUp:(NSEvent*)event { // See: https://github.com/flutter/flutter/issues/115015 // See: http://www.openradar.me/FB12050037 // See: https://developer.apple.com/documentation/appkit/nsresponder/1535349-mouseup + // + // TODO(cbracken): https://github.com/flutter/flutter/issues/154063 + // Remove this workaround when we drop support for macOS 12 (Monterey). [self.nextResponder mouseUp:event]; }