Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented May 12, 2023

@dnfield dnfield requested a review from loic-sharma May 12, 2023 23:03
@flutter-dashboard flutter-dashboard bot added embedder Related to the embedder API platform-macos labels May 12, 2023
@loic-sharma loic-sharma requested a review from dkwingsmt May 12, 2023 23:03
@dnfield
Copy link
Contributor Author

dnfield commented May 12, 2023

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.

Copy link
Member

@cbracken cbracken left a 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.

Copy link
Member

@loic-sharma loic-sharma left a 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.

Copy link
Member

@cbracken cbracken left a 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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label May 17, 2023
@auto-submit auto-submit bot merged commit 0ae3719 into flutter:main May 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 17, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App embedder Related to the embedder API platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Embedder API] Fix FlutterEngineNotifyDisplayUpdate's ABI stability

3 participants