Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mac Catalyst] DeviceDisplay.MainDisplayInfo is not refreshed #22642

Open
mikeparker104 opened this issue May 24, 2024 · 1 comment
Open

[Mac Catalyst] DeviceDisplay.MainDisplayInfo is not refreshed #22642

mikeparker104 opened this issue May 24, 2024 · 1 comment
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with partner Issue or Request from a partner team platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Milestone

Comments

@mikeparker104
Copy link
Contributor

mikeparker104 commented May 24, 2024

Description

The information (DisplayInfo) returned by DeviceDisplay.MainDisplayInfo does not get refreshed on macOS after changing display options (in Settings > Displays) like resolution, scaling, rotation, etc., or when switching the display that is designated as the Main display. Potentially related to #22634.

For comparison, on Windows the expected DisplayInfo is returned reflecting changes to system display configuration. Expectation is that the macOS version behaves consistently with the Windows version.

Steps to Reproduce

Create a file -> new .NET MAUI app. In MainPage.xaml.cs, paste the ReadDeviceDisplay method from the Main display info documentation modifying to output to the console instead of the DisplayDetailsLabel used in that example. Then, update the templated Button click event handler to call the ReadDeviceDisplay function.

void ReadDeviceDisplay()
{
    System.Text.StringBuilder sb = new System.Text.StringBuilder();

    sb.AppendLine($"Pixel width: {DeviceDisplay.Current.MainDisplayInfo.Width} / Pixel Height: {DeviceDisplay.Current.MainDisplayInfo.Height}");
    sb.AppendLine($"Density: {DeviceDisplay.Current.MainDisplayInfo.Density}");
    sb.AppendLine($"Orientation: {DeviceDisplay.Current.MainDisplayInfo.Orientation}");
    sb.AppendLine($"Rotation: {DeviceDisplay.Current.MainDisplayInfo.Rotation}");
    sb.AppendLine($"Refresh Rate: {DeviceDisplay.Current.MainDisplayInfo.RefreshRate}");

    System.Diagnostics.Debug.WriteLine(sb.ToString());
}

Using screen resolution as the example of a change to display information expected to be reflected in the DisplayInfo.

  1. Run the .NET MAUI app on macOS
  2. Click the templated Button to output the Main display info
  3. Open the Settings app and change the screen resolution for the designated Main display
  4. Click the templated Button to output the Main display info

EXPECTED

The (DisplayInfo) output the second time around is different to the first. In this case, showing different height and width values.

ACTUAL

The (DisplayInfo) outputs remain the same.

Link to public reproduction project repository

No response

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

Mac Catalyst 13.1

Did you find any workaround?

No response

Relevant log output

No response

@mikeparker104 mikeparker104 added the t/bug Something isn't working label May 24, 2024
@dotnet-policy-service dotnet-policy-service bot added the partner Issue or Request from a partner team label May 24, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@mikeparker104 mikeparker104 added area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/macOS 🍏 macOS / Mac Catalyst labels May 24, 2024
@rmarinho rmarinho added this to the Backlog milestone May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with partner Issue or Request from a partner team platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants