Windows-Auto-Night-Mode icon indicating copy to clipboard operation
Windows-Auto-Night-Mode copied to clipboard

Auto-Dark mode doesn't switch if sunrise/sunset occurs while computer is asleep

Open ddiggles opened this issue 2 years ago • 4 comments

Description

Hello!

Auto Dark Mode works fine on my desktop. If I shut my computer down after sunset, with ADM on, then turn my computer on in the morning after sunrise, as soon as ADM loads, it switches to light mode.

On my new laptop (Lenovo Slim 7 Pro X), if sunset occurs while the computer is asleep (lid shut), ADM does not switch, and then I have to manually toggle it. This same behavior is happening with Windows Night Light. I'm guessing they're related, because both are using sunrise/sunset to do their thing.

Not sure how to troubleshoot this. Any suggestions are appreciated.

Expected Behavior

If laptop is asleep during a trigger time (sunset), ADM does not switch when I wake the laptop, like I believe it should.

I have to go in and do it manually.

Log Data

service.log config yaml.txt

Operating System

Windows 11 Pro 22000.918

Commit Hash and Version

  • Commit: 5e6ea8a
  • Service: 10.1.0.10
  • Updater: 2.4.2
  • App: 10.0.1.0
  • Shell: 1.3.1.0
  • .Net: 6.0.0

Screenshots

No response

ddiggles avatar Sep 02 '22 01:09 ddiggles

i have same problem too,Lenovo yaga 13s AMD windows11。

jelly-mazic avatar Sep 04 '22 01:09 jelly-mazic

I assume the logs you provided are for the desktop as I can't see any system resume events there.

Hm unfortunately I can't really see anything wrong with the logs. As soon as ADM starts, it fires all events and changes the requested regkeys. ADM seems to be doing what it's supposed to.

Maybe we can get this to work still:

First, please update to the latet beta version and try to use theme switch with this flag enabled: image

Spiritreader avatar Sep 05 '22 22:09 Spiritreader

I assume the logs you provided are for the desktop as I can't see any system resume events there.

Hm unfortunately I can't really see anything wrong with the logs. As soon as ADM starts, it fires all events and changes the requested regkeys. ADM seems to be doing what it's supposed to.

Maybe we can get this to work still:

First, please update to the latet beta version and try to use theme switch with this flag enabled: image

Hello, I also encountered this problem, when I turn off the computer in dark mode, turn on the computer at noon the next day, ADM will not turn my computer into light mode after self-starting. Even if I manually turn ADM off and on again, it still doesn't automatically change the computer to light mode.

BKLTS avatar Sep 10 '22 02:09 BKLTS

I assume the logs you provided are for the desktop as I can't see any system resume events there.

Hm unfortunately I can't really see anything wrong with the logs. As soon as ADM starts, it fires all events and changes the requested regkeys. ADM seems to be doing what it's supposed to.

Maybe we can get this to work still:

First, please update to the latet beta version and try to use theme switch with this flag enabled: image

I tried to use theme switch with the flag enabled, it still has this problem.

BKLTS avatar Sep 10 '22 02:09 BKLTS

I assume the logs you provided are for the desktop as I can't see any system resume events there. Hm unfortunately I can't really see anything wrong with the logs. As soon as ADM starts, it fires all events and changes the requested regkeys. ADM seems to be doing what it's supposed to. Maybe we can get this to work still: First, please update to the latet beta version and try to use theme switch with this flag enabled: image

I tried to use theme switch with the flag enabled, it still has this problem.

Could you upload your logs please so I can take a look?

Spiritreader avatar Sep 27 '22 11:09 Spiritreader

It fine in prev version. But not now. It's says the theme switched. But seems failed

2022-09-29 09:13:47 | Info | PowerEventHandler.SystemEvents_PowerModeChanged: system resuming from suspended state, refreshing theme 
2022-09-29 09:13:49 | Info | AppsSwitchThemeFile.HandleSwitch: update info - previous: Dark, now: Light, mode: Switch 
2022-09-29 09:13:49 | Info | SystemSwitchThemeFile.SwitchSystemTheme: update info - previous: Dark/Accent, now: Light/NoAccent, mode: Switch, accent: yes 
2022-09-29 09:13:49 | Error | ThemeManager.UpdateTheme: couldn't apply managed theme file:  ArgumentOutOfRangeException > Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') > Void ThrowArgumentOutOfRange_IndexException()
2022-09-29 09:13:49 | Info | ThemeManager.UpdateTheme: light theme switch performed, source: SystemResume 

SettingDust avatar Sep 29 '22 01:09 SettingDust

It fine in prev version. But not now. It's says the theme switched. But seems failed

2022-09-29 09:13:47 | Info | PowerEventHandler.SystemEvents_PowerModeChanged: system resuming from suspended state, refreshing theme 
2022-09-29 09:13:49 | Info | AppsSwitchThemeFile.HandleSwitch: update info - previous: Dark, now: Light, mode: Switch 
2022-09-29 09:13:49 | Info | SystemSwitchThemeFile.SwitchSystemTheme: update info - previous: Dark/Accent, now: Light/NoAccent, mode: Switch, accent: yes 
2022-09-29 09:13:49 | Error | ThemeManager.UpdateTheme: couldn't apply managed theme file:  ArgumentOutOfRangeException > Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') > Void ThrowArgumentOutOfRange_IndexException()
2022-09-29 09:13:49 | Info | ThemeManager.UpdateTheme: light theme switch performed, source: SystemResume 

Hmm about that, it seems like a section in the theme file can't be written to. Please update to Beta 10.3.0.4, run again and re-post the logs. I've added better exception handling for that section.

Spiritreader avatar Oct 02 '22 17:10 Spiritreader

Windows 11 does no longer allow theme switching when the session is locked. I've addressed this by moving the switch to the session unlock event. Win 10 still works the same for now.

Spiritreader avatar Oct 10 '22 17:10 Spiritreader

should be resolved since Beta 10.1.0.38. Feel free to re-open if it still occurs.

Spiritreader avatar Oct 13 '22 16:10 Spiritreader