Skip to content

[Mac Catalyst] DeviceDisplay.KeepScreenOn not being respected on Mac OS #26059

@DanOrlovsky

Description

@DanOrlovsky

Description

We have a Maui app targeting both Windows and MacCatalyst. There is a state the app can be in that requires us to keep the sceen on for the user so the app can function whether the user is at the computer or not.

To facilitate this, we are setting KeepScreenOn on DeviceDisplay:

await MainThread.InvokeOnMainThreadAsync(() =>
{
    DeviceDisplay.Current.KeepScreenOn = true;
});    

This is working fine in windows. The Mac build seems to be ignoring this setting completely.

Steps to Reproduce

Make sure your computer is set to sleep in a reasonable amount of time.

In a MacCatalyst maui app, set the DeviceDisplay.Current.KeepScreenOn to true.

Observe the screen will go to sleep.

Link to public reproduction project repository

https://github.com/DanOrlovsky/MauiBlazorNet9ScreenOnDemo

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

MacOS 14 (Sonoma) and MacOS 15 (Sequoia) and both .Net 8 and .Net 9

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infoarea-essentials-devicedisplaypartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/macosmacOS / Mac Catalystt/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions