这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@9AZX
Copy link
Contributor

@9AZX 9AZX commented Mar 2, 2025

This PR enhances the Windows implementation by adding support for retrieving display properties, available displays, refresh rate, dpi, size, and more.

Fixes: #160660, #125939

Pre-launch Checklist

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. platform-windows Building on or for Windows specifically a: desktop Running on desktop labels Mar 2, 2025
@9AZX 9AZX force-pushed the windows_displays_monitor branch from b9dd753 to 71f9c40 Compare March 11, 2025 10:49
@loic-sharma loic-sharma self-requested a review March 24, 2025 17:18
@9AZX 9AZX force-pushed the windows_displays_monitor branch from 71f9c40 to 6d71dc3 Compare April 3, 2025 09:20
@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@loic-sharma
Copy link
Member

loic-sharma commented Apr 28, 2025

@9AZX Apologies for the long response time. This is looking great! I left some minor nitpicks. Feel free to tag me when this is ready for another review.

@9AZX 9AZX force-pushed the windows_displays_monitor branch 5 times, most recently from 086194e to 2ec4e8f Compare May 1, 2025 07:52
@loic-sharma
Copy link
Member

FYI you have the some test failures: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8716084517876313281/+/u/test:_test:_Host_Tests_for_host_debug_unopt/stdout

[151/610] FlutterWindowsEngineTest.RunHeadless (943 ms)
[INFO:flutter/testing/test_timeout_listener.cc(75)] Test timeout of 300 seconds per test case will be enforced.
Note: Google Test filter = FlutterWindowsEngineTest.RunHeadless
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FlutterWindowsEngineTest
[ RUN      ] FlutterWindowsEngineTest.RunHeadless
WARN: Renderer11.cpp:972 (initializeD3DDevice): Failed creating Debug D3D11 device - falling back to release runtime.
WARN: Renderer11.cpp:972 (initializeD3DDevice): Failed creating Debug D3D11 device - falling back to release runtime.
[FATAL:flutter/shell/common/display_manager.cc(27)] Check failed: !displays.empty().
[151/610] FlutterWindowsEngineTest.RunHeadless returned/aborted with exit code 3 (943 ms)
[152/610] FlutterWindowsEngineTest.PlatformMessageRespondOnDifferentThread (882 ms)
[INFO:flutter/testing/test_timeout_listener.cc(75)] Test timeout of 300 seconds per test case will be enforced.
Note: Google Test filter = FlutterWindowsEngineTest.PlatformMessageRespondOnDifferentThread

FYI, you can run these tests locally on your machine by running out/flutter_windows_unittests.exe.

@9AZX 9AZX force-pushed the windows_displays_monitor branch from ecd4661 to 2086a8b Compare June 18, 2025 10:27
@9AZX
Copy link
Contributor Author

9AZX commented Jun 18, 2025

FYI, you can run these tests locally on your machine by running out/flutter_windows_unittests.exe.

I was doing that, but i think the test runs headless only on the CI. I'm not getting any errors locally :(

@9AZX 9AZX force-pushed the windows_displays_monitor branch from 2086a8b to 84316be Compare June 23, 2025 13:46
@loic-sharma loic-sharma requested review from knopp and mattkae June 23, 2025 21:56
@loic-sharma
Copy link
Member

@mattkae @knopp Would y'all be able to review this as well? I suspect this will be useful for multi-window :)

@mattkae
Copy link
Contributor

mattkae commented Aug 6, 2025

@9AZX Do you have a status on this? I accidentally opened up #173301 and was wondering if you were still planning on merging this one too :)

@9AZX
Copy link
Contributor Author

9AZX commented Aug 6, 2025

Hello, yes i was still planning to land this one but was waiting for reviews...

@9AZX 9AZX requested a review from loic-sharma August 6, 2025 15:32
@mattkae
Copy link
Contributor

mattkae commented Aug 6, 2025

Hello, yes i was still planning to land this one but was waiting for reviews...

I will review today! Sorry I had forgotten about it.

Copy link
Contributor

@mattkae mattkae left a comment

Choose a reason for hiding this comment

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

A few small things, but mostly in line with what I had in mind too :)

@9AZX 9AZX requested a review from mattkae August 7, 2025 06:34
Copy link
Contributor

@mattkae mattkae left a comment

Choose a reason for hiding this comment

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

This looks good to me 🎉

@mattkae mattkae enabled auto-merge August 7, 2025 12:36
@mattkae mattkae removed the request for review from knopp August 7, 2025 13:21
@mattkae mattkae added this pull request to the merge queue Aug 7, 2025
Merged via the queue into flutter:master with commit 0accf67 Aug 7, 2025
181 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 7, 2025
flutter/flutter@9de63a0...92a6bfb

2025-08-07 engine-flutter-autoroll@skia.org Roll Packages from f0b2726 to 6efb759 (4 revisions) (flutter/flutter#173414)
2025-08-07 jon.i@hotmail.fr Provide monitor list, display size, refresh rate, and more for Windows (flutter/flutter#164460)
2025-08-07 1063596+reidbaker@users.noreply.github.com [android][tool] Consolidate minimum versions for android projects.  (flutter/flutter#171965)
2025-08-07 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 2Mo76-tiDj4ZCZbPv... to i4vsuEGyP8Xeb5tiy... (flutter/flutter#173409)
2025-08-07 engine-flutter-autoroll@skia.org Roll Skia from 9a886bdfb716 to a6ccfeafbfba (1 revision) (flutter/flutter#173384)
2025-08-07 sokolovskyi.konstantin@gmail.com Fix drawerScrimColor transition. (flutter/flutter#173280)
2025-08-07 engine-flutter-autoroll@skia.org Roll Skia from dd60ed46a006 to 9a886bdfb716 (2 revisions) (flutter/flutter#173382)
2025-08-06 engine-flutter-autoroll@skia.org Roll Skia from 05d82af3f4bd to dd60ed46a006 (2 revisions) (flutter/flutter#173376)
2025-08-06 engine-flutter-autoroll@skia.org Roll Skia from 5518bb27db67 to 05d82af3f4bd (2 revisions) (flutter/flutter#173372)
2025-08-06 engine-flutter-autoroll@skia.org Roll Skia from 9bb1fc4bc326 to 5518bb27db67 (2 revisions) (flutter/flutter#173363)
2025-08-06 engine-flutter-autoroll@skia.org Roll Skia from a918c0e08500 to 9bb1fc4bc326 (24 revisions) (flutter/flutter#173355)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
houssemeddinefadhli81 pushed a commit to houssemeddinefadhli81/flutter that referenced this pull request Aug 7, 2025
flutter#164460)

This PR enhances the Windows implementation by adding support for
retrieving display properties, available displays, refresh rate, dpi,
size, and more.

Fixes: flutter#160660, flutter#125939

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
flutter#164460)

This PR enhances the Windows implementation by adding support for
retrieving display properties, available displays, refresh rate, dpi,
size, and more.

Fixes: flutter#160660, flutter#125939

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
flutter#164460)

This PR enhances the Windows implementation by adding support for
retrieving display properties, available displays, refresh rate, dpi,
size, and more.

Fixes: flutter#160660, flutter#125939

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
flutter#164460)

This PR enhances the Windows implementation by adding support for
retrieving display properties, available displays, refresh rate, dpi,
size, and more.

Fixes: flutter#160660, flutter#125939

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
bufffun pushed a commit to bufffun/flutter that referenced this pull request Oct 3, 2025
flutter#164460)

This PR enhances the Windows implementation by adding support for
retrieving display properties, available displays, refresh rate, dpi,
size, and more.

Fixes: flutter#160660, flutter#125939

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop engine flutter/engine related. See also e: labels. platform-windows Building on or for Windows specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WidgetsBinding.instance.platformDispatcher.displays.first.size returns Size(0.0, 0.0) zero on Windows

4 participants