Skip to content

ShouldUseDarkColorsAsync always returns False #32

Description

@markatosi
  • Version: 33.2.0.53881
  • Target: .net 9.0 MacOS 15.2
public static class ThemeService
{
   public static void InitializeThemeListener()
    {
        var nativeTheme = Electron.NativeTheme;

        nativeTheme.Updated += async () =>
        {
            var isDarkMode = await nativeTheme.ShouldUseDarkColorsAsync();
            Console.WriteLine(isDarkMode
                ? $"OS theme changed. Dark Mode: {isDarkMode}"
                : $"OS theme changed. Light Mode: {isDarkMode}");
        };
    }
}

The listener is triggered appropriately when I change the default theme on macOS Sequoia.
Am I misunderstanding how to check for OS initiated theme changes?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions