-
Notifications
You must be signed in to change notification settings - Fork 6k
Report displays for macOS #41998
Report displays for macOS #41998
Conversation
import 'dart:ui';
// import 'package:flutter/widgets.dart';
// import 'package:flutter/services.dart';
void main() {
// WidgetsFlutterBinding.ensureInitialized();
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
print(PlatformDispatcher.instance.displays.toList());
print(PlatformDispatcher.instance.implicitView!.display);
PlatformDispatcher.instance.onMetricsChanged = () {
print(PlatformDispatcher.instance.displays.toList());
print(PlatformDispatcher.instance.implicitView!.display);
};
}Is the simple Dart application I've been using to test this. In a default Flutter app it's working well to report display sizes when the window gets moved around to different monitors or the monitor configuration changes. |
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments.
shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once you've double-checked FlutterWindowMetricsEvent.display_id's type: #41998 (comment)
Please make sure to also get Chris's approval for macOS embedder changes and Chris's/Chinmay's approval for embedder API changes.
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
| /// Display refers to a graphics hardware system consisting of a framebuffer, | ||
| /// typically a monitor or a screen. This ID is unique per display and is | ||
| /// stable until the Flutter application restarts. | ||
| typedef uint64_t FlutterEngineDisplayId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@loic-sharma fyi
…127043) flutter/engine@47fd496...0ae3719 2023-05-17 [email protected] Report displays for macOS (flutter/engine#41998) 2023-05-17 [email protected] Fix bounds when painting style is stroke width for image shaders (flutter/engine#42052) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#127043) flutter/engine@47fd496...0ae3719 2023-05-17 [email protected] Report displays for macOS (flutter/engine#41998) 2023-05-17 [email protected] Fix bounds when painting style is stroke width for image shaders (flutter/engine#42052) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/flutter#125939 and flutter/flutter#125938 for macOS
fixes flutter/flutter#121352