microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.43k stars 6.45k forks source link

The Icon of Awake Is Gone #34148

Open Emmm2333doge opened 1 month ago

Emmm2333doge commented 1 month ago

Microsoft PowerToys version

0.83.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Awake

Steps to reproduce

The taskbar notification area icon of Awake is gone.

✔️ Expected Behavior

There's an icon of Awake in the taskbar notification area.

❌ Actual Behavior

I cannot find the icon and I have to open PowerToys settings just to change my settings, which is very inconvenient.

Other Software

No response

similar-issues-ai[bot] commented 1 month ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

crutkas commented 1 month ago

/reportbug

crutkas commented 1 month ago

we did a lot of heavy refactors, the icon could be hide a ^ symbol in system tray image image

mmitchel commented 1 month ago

This is a thing; and it is not in the tray overflow until toggled off then on again. Some could confuse the new icon for something else, but I hover over till I don't find it.

dend commented 1 month ago

@Emmm2333doge @mmitchel was this after the upgrade? Can you please share the Awake logs on this thread to see if there were any errors launching the app?

PraneshBalasubramaniam commented 1 month ago

I too have similar issue. The System tray icon disappears sometime and only appears after turning off and on the awake feature. This is my logs. awake-log_2024-08-09.txt awake-log_2024-08-08.txt awake-log_2024-08-07.txt

eldair commented 1 month ago

Same here and it doesn't reappear after the module is turned off/on, I have to restart powertoys for it to come back. Started happening after the latest version update.

Edit: it usually happens after screen was off for a while Edit 2: here are some errors from event viewer (not sure if they preceded icon disappearing or they happened when I tried to turn awake off/on)

image image

dend commented 1 month ago

I too have similar issue. The System tray icon disappears sometime and only appears after turning off and on the awake feature. This is my logs. awake-log_2024-08-09.txt awake-log_2024-08-08.txt awake-log_2024-08-07.txt

Thanks @PraneshBalasubramaniam - can you please also provide the native Awake logs (that are detached from PT)? They should be in the same folder.

dend commented 1 month ago

Same here and it doesn't reappear after the module is turned off/on, I have to restart powertoys for it to come back. Started happening after the latest version update.

Edit: it usually happens after screen was off for a while Edit 2: here are some errors from event viewer (not sure if they preceded icon disappearing or they happened when I tried to turn awake off/on)

image image

This snapshot is actually immensely helpful, thank you @eldair!

Emmm2333doge commented 1 month ago

Now I realize that I might came to a wrong place... I found something else in my system tray also keep disappearing! Maybe It's Windows 11's bug! I might just go to Windows 11's Feedback Hub...

PraneshBalasubramaniam commented 1 month ago

I too have similar issue. The System tray icon disappears sometime and only appears after turning off and on the awake feature. This is my logs. awake-log_2024-08-09.txt awake-log_2024-08-08.txt awake-log_2024-08-07.txt

Thanks @PraneshBalasubramaniam - can you please also provide the native Awake logs (that are detached from PT)? They should be in the same folder.

Thanks for the replay. I have attached the log you have requested. I found these logs inside 0.83.0.0 folder under the same folder. Log_2024-08-01.txt Log_2024-08-02.txt Log_2024-08-03.txt Log_2024-08-04.txt Log_2024-08-05.txt Log_2024-08-06.txt Log_2024-08-07.txt Log_2024-08-08.txt Log_2024-08-09.txt Log_2024-08-10.txt 0e239396-000e-4d07-9cd5-19982408ed0cLog_2024-08-06.txt

And can we please keep this issue open, the issue is not resolved yet.

morganicist commented 1 month ago

I'm having the same issue. Awake icon is missing, toggling on/off in PowerToys settings will make it appear, but it will disappear again after a reboot.

eldair commented 1 month ago

@dend Hi, can you please reopen this issue, it might not be what the OPs problem was but the issue is real

dend commented 1 month ago

Reopening as I need to investigate the root cause. It's possible that it's an Awake issue and not necessarily a Windows issue. The log from @eldair is actually pointing to a potential error path that I am working on.

o-l-a-v commented 4 weeks ago

I read the following in the logs located at %LOCALAPPDATA%\Microsoft\PowerToys\Awake\Logs:

...
[07:24:18.6596052] [Info] Program::HandleCommandLineArguments
    Reading configuration file: C:\Users\olav.birkeland\AppData\Local\Microsoft\PowerToys\Awake\settings.json
[07:24:18.7887929] [Info] Program::ProcessSettings
    Identified custom time shortcuts for the tray: 0
[07:24:18.8023681] [Info] Manager::CancelExistingThread
    Attempting to ensure that the thread is properly cleaned up...
[07:24:18.8035111] [Info] Manager::CancelExistingThread
    Instantiating of new token source and thread token completed.
[07:24:18.8040981] [Error] Program::ProcessSettings
    There was a problem reading the configuration file. Error: System.ComponentModel.Win32Exception Failed to change tray icon. Action: Update and error code: 0
...

I then disabled Awake from PowerToys menu, deleted %LOCALAPPDATA%\Microsoft\PowerToys\Awake\settings.json, enabled Awake, and tray icon appeared.


I first tried to uninstall PowerToys. It did not remove %LOCALAPPDATA%\Microsoft\PowerToys, thus the seemingly broken %LOCALAPPDATA%\Microsoft\PowerToys\Awake\settings.json was left behind too.

mmitchel commented 4 weeks ago

Not a Windows 11 bug; previous version worked. It showed up with 0.83 and the new icons. Running with or without elevated privileges also seems to have no impact on the occurrence of the issue.

SoCalDude commented 4 weeks ago

👉🏻 Consider this my "me, too" post. Starting with v0.83.0, the Awake feature is not automatically started (and therefore, not shown in the system tray). I have to go to the PowerToys Dashboard and toggle it off and then back on.

Additionally, I have a custom configuration, adding some custom timings (as shown in the attached snippet).

2024-08-14-095300

anpotdar commented 4 weeks ago

Seeing this issue as well. The icon disappears every time I unlock my PC. Disabling and enabling Awake in PowerToys brings it back.

BrBill commented 4 weeks ago

Not only does it disappear for me, it also quits running overnight if I have it turned on, even with "Keep awake indefinitely". Due to this problem, I lose the ability to access remotely because Awake quits/bails and then the system goes to sleep.

edjia commented 4 weeks ago

I'm having the same issue. Awake icon is missing, toggling on/off twice in PowerToys settings will make it appear, but it will disappear again after a reboot.

cmdntfnd commented 3 weeks ago

Same issue here. The logs mention a configuration file issue but deleting it and starting afresh doesn't fix anything. Have the issue on two computers, but only noticed on one and thought that computer was just buggy until it happened once on another, which prompted me to look for bug reports on github. The computer on which it always, systematically fails to start on boot is a Surface Go 2, and my other computer on which the bug didn't seem to trigger systematically is an asus g14 gaming laptop. I have a suspicion the issue might be with some sync routine and slower computers make it heavily likely that it's going to act up?

On the surface go 2 I really have to wait a little while after boot to disable/reenable Awake. If I do it as soon as I can launch the powertoys UI it might not necessarily immediately work either. Just rebooted my asus laptop and the bug didn't trigger again. If I remember right it only triggered after the last windows update, possibly the first post-update boot causes the PC to be busy enough to cause this to happen.

Logs:

[14:32:33.3492610] [Error] Program::ProcessSettings There was a problem reading the configuration file. Error: System.ComponentModel.Win32Exception Failed to change tray icon. Action: Update and error code: 0 [14:32:33.3535962] [Info] <>c::b17_0 Setting state to ES_CONTINUOUS [14:34:45.2197787] [Info] Program::Exit Réception d’un signal pour mettre fin au processus. Nous vérifions que nous avons quitté... [14:34:45.2786047] [Info] Manager::SetPassiveKeepAwake Operating in passive mode (computer's standard power plan). No custom keep awake settings enabled. [14:34:45.2824883] [Info] Manager::CancelExistingThread Attempting to ensure that the thread is properly cleaned up... [14:34:45.2848805] [Info] Manager::CancelExistingThread Instantiating of new token source and thread token completed. [14:34:45.3081708] [Info] <>c::b17_0 Setting state to ES_CONTINUOUS [14:34:45.5468864] [Error] Program::AwakeUnhandledExceptionCatcher System.ComponentModel.Win32Exception (0x80004005): Failed to change tray icon. Action: Update and error code: 0 at Awake.Core.TrayHelper.SetShellIcon(IntPtr hWnd, String text, Icon icon, TrayIconAction action) at Awake.Core.Manager.SetPassiveKeepAwake(Boolean updateSettings) at Awake.Core.Manager.CompleteExit(Int32 exitCode) at Awake.Program.Exit(String message, Int32 exitCode) at Awake.Program.<>cDisplayClass19_0.b0() [14:34:45.5474320] [Error] Program::AwakeUnhandledExceptionCatcher at Awake.Core.TrayHelper.SetShellIcon(IntPtr hWnd, String text, Icon icon, TrayIconAction action) at Awake.Core.Manager.SetPassiveKeepAwake(Boolean updateSettings) at Awake.Core.Manager.CompleteExit(Int32 exitCode) at Awake.Program.Exit(String message, Int32 exitCode) at Awake.Program.<>cDisplayClass19_0.b0()

dend commented 3 weeks ago

0x80004005 (or 2147500037 in decimal) is a generic E_FAIL. To make sure I repro the issue, I amended the API that is marked for tray API setup to also set the last Win32 error (it doesn't right now) so that should help diagnose the issue in the future.

Is this occurring on computer boot/restart only? @N1k41d0 @edjia @eldair @BrBill @anpotdar @SoCalDude @mmitchel @o-l-a-v @PraneshBalasubramaniam

eldair commented 3 weeks ago

@dend for me it happens on unlock after windows was locked and display was off

dend commented 3 weeks ago

Good news - I found the race condition in my code. Will be fixing in an upcoming PR.

dend commented 1 week ago

This is fixed in the latest PowerToys release.

mendhak commented 1 week ago

Thanks for your efforts!

huythach83 commented 6 days ago

I am afraid that the problem with Awake still exists. After updating to PowerToys v0.84.0, Awake is working for a while and after a restart, its icon is nowhere to be found. Try to disable/enable it a few times; if I am lucky, the Awake icon will reappear, and I can use it.

If you want me to provide anything to help with debugging, I will happily provide it.

anton-hystrix commented 6 days ago

I second this. Just started using Awake in version 0.84 and the icon was shown yesterday but froze and then disappeared today.

cmdntfnd commented 5 days ago

I can confirm it's still crashing. Here are the logs. 048cb40c-44ba-4aa4-afc1-1642900fec6bLog_2024-09-06.txt Log_2024-09-06.txt

Program::AwakeUnhandledExceptionCatcher System.ComponentModel.Win32Exception (0x80004005): Failed to change tray icon. Action: Update and error code: -2147467259 at Awake.Core.TrayHelper.SetShellIcon(IntPtr hWnd, String text, Icon icon, TrayIconAction action)

SoCalDude commented 3 days ago

More details here in this related ticket. . .

dend commented 3 days ago

I can confirm it's still crashing. Here are the logs. 048cb40c-44ba-4aa4-afc1-1642900fec6bLog_2024-09-06.txt Log_2024-09-06.txt

Program::AwakeUnhandledExceptionCatcher System.ComponentModel.Win32Exception (0x80004005): Failed to change tray icon. Action: Update and error code: -2147467259 at Awake.Core.TrayHelper.SetShellIcon(IntPtr hWnd, String text, Icon icon, TrayIconAction action)

This is helpful - I see the potential issue:

[17:06:56.0905399] [Info] Program::Exit
    Awake is already running! Exiting the application.
[17:06:56.4336981] [Info] Manager::SetPassiveKeepAwake
    Operating in passive mode (computer's standard power plan). No custom keep awake settings enabled.
[17:06:56.4504114] [Info] Manager::CancelExistingThread
    Attempting to ensure that the thread is properly cleaned up...
[17:06:56.4534197] [Info] Manager::CancelExistingThread
    Instantiating of new token source and thread token completed.
[17:06:56.4697424] [Info] TrayHelper::SetShellIcon
    Setting the shell icon.
Text: PowerToys Awake [Passive]
Action: Update
[17:06:56.4741116] [Info] TrayHelper::SetShellIcon
    Adding or updating tray icon. HIcon handle is 262599
HWnd: 0

Looks like Awake tried to launch a second instance (which is not supported) and then things cascaded from there. I am working on adding some checks for this that should be released in the next version.

ksbrar commented 3 days ago

Sidenote: This has been happening to me as well, and the workaround I have found has been to completely exit and restart PowerToys itself. That at least brings the icon (and correct behavior) back to the system tray for a while.

HarryLesnar24 commented 1 day ago

Hi @dend, Today I ran in to same issue the tray icon missing after when I updated system driver and restarted it gone from tray. version 0.83.0.0 if I manually try to disable awake and enable it means the icon get back but 0.84.1.0 I need to do twice not one time then only I got the icon back to tray

6f59a7b1-56fe-4dab-a773-306bf376499bLog_2024-09-10.txt awake-log_2024-09-10.txt Log_2024-09-10.txt

[17:04:44.5899879] [Info] Program::Exit Awake is already running! Exiting the application. [17:04:44.5996588] [Info] Manager::SetPassiveKeepAwake Operating in passive mode (computer's standard power plan). No custom keep awake settings enabled. [17:04:44.6030391] [Info] Manager::CancelExistingThread Attempting to ensure that the thread is properly cleaned up... [17:04:44.6037498] [Info] Manager::CancelExistingThread Instantiating of new token source and thread token completed. [17:04:44.6060835] [Info] TrayHelper::SetShellIcon Setting the shell icon. Text: PowerToys Awake [Passive] Action: Update [17:04:44.6068603] [Info] TrayHelper::SetShellIcon Adding or updating tray icon. HIcon handle is 589981 HWnd: 0 [17:04:44.6173800] [Error] Program::AwakeUnhandledExceptionCatcher System.ComponentModel.Win32Exception (0x80004005): Failed to change tray icon. Action: Update and error code: -2147467259 at Awake.Core.TrayHelper.SetShellIcon(IntPtr hWnd, String text, Icon icon, TrayIconAction action) at Awake.Core.Manager.SetPassiveKeepAwake(Boolean updateSettings) at Awake.Core.Manager.CompleteExit(Int32 exitCode) at Awake.Program.Exit(String message, Int32 exitCode) at Awake.Program.Main(String[] args) [17:04:44.6175098] [Error] Program::AwakeUnhandledExceptionCatcher at Awake.Core.TrayHelper.SetShellIcon(IntPtr hWnd, String text, Icon icon, TrayIconAction action) at Awake.Core.Manager.SetPassiveKeepAwake(Boolean updateSettings) at Awake.Core.Manager.CompleteExit(Int32 exitCode) at Awake.Program.Exit(String message, Int32 exitCode) at Awake.Program.Main(String[] args)

I attached Log file you can check it if any further details required ask me I can provide.

stephanm74 commented 1 day ago

Ever since i updated to most recent version, it is even worse than before. This is old behavior: https://github.com/microsoft/PowerToys/issues/34368#issuecomment-2299598181

New behavior is just that the tray icon is gone and even enabling and disabling awake in powertoys doesnt bring it back.

ZZJHONS commented 2 hours ago

It also happened to me that after updating from 83 to 84.1 the icon was missing, tried rebooting but it did not show up, also tried stopping Awake and running it gain and it also neither appeared, only after doing on/off a second time it does show up and is responsive.