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

Awake tray icon missing in 0.85 #35250

Open
edjia opened this issue Oct 4, 2024 · 30 comments
Open

Awake tray icon missing in 0.85 #35250

edjia opened this issue Oct 4, 2024 · 30 comments
Assignees
Labels
Issue-Bug Something isn't working Product-Awake Issues regarding the PowerToys Awake utility

Comments

@edjia
Copy link

edjia commented Oct 4, 2024

Microsoft PowerToys version

0.85

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Awake

Steps to reproduce

tray icon missing after pc reboot.
awake.zip

✔️ Expected Behavior

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

❌ Actual Behavior

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

Other Software

OS: win11 pro for workstations 24H2 26100.1882 with Windows Feature Experience Pack 1000.26100.23.0

@dend

@edjia edjia added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Oct 4, 2024
Copy link

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.

@dend dend self-assigned this Oct 4, 2024
@dend dend added Product-Awake Issues regarding the PowerToys Awake utility and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Oct 4, 2024
@o-l-a-v
Copy link

o-l-a-v commented Oct 4, 2024

Same here on Windows 11 24H2. Even did a uninstall and deleted %LOCALAPPDATA%\PowerToys before installing v0.85.0.

Click to view logs
[08:28:14.8723787] [Info] Program::Main
    Launching Awake...
[08:28:14.8871318] [Info] Program::Main
    0.85.0.0
[08:28:14.8873664] [Info] Program::Main
    Build: PROMETHEAN_09082024
[08:28:14.8887250] [Info] Program::Main
    OS: Microsoft Windows NT 10.0.26100.0
[08:28:14.9095781] [Info] Program::Main
    OS Build: Windows 10 Enterprise 24H2 26100.1.amd64fre.ge_release.240331-1435
[08:28:14.9916145] [Info] Program::Main
    {}
[08:28:14.9918647] [Info] Program::Main
    Parsing parameters...
[08:28:15.0815375] [Info] Program::HandleCommandLineArguments
    Starting with PID binding.
[08:28:15.0834137] [Info] Program::HandleCommandLineArguments
    The value for --use-pt-config is: True
[08:28:15.0836618] [Info] Program::HandleCommandLineArguments
    The value for --display-on is: True
[08:28:15.0838107] [Info] Program::HandleCommandLineArguments
    The value for --time-limit is: 0
[08:28:15.0839497] [Info] Program::HandleCommandLineArguments
    The value for --pid is: 14052
[08:28:15.0840787] [Info] Program::HandleCommandLineArguments
    The value for --expire-at is: 
[08:28:15.0842342] [Info] Program::HandleCommandLineArguments
    The value for --use-parent-pid is: False
[08:28:15.0921302] [Info] <>c__DisplayClass17_0::<RunOnMainThread>b__0
    Thread execution is on: 5
[08:28:15.0987790] [Info] Program::HandleCommandLineArguments
    Reading configuration file: C:\Users\olav.birkeland\AppData\Local\Microsoft\PowerToys\Awake\settings.json
[08:28:15.1057015] [Info] <>c__DisplayClass13_0::<InitializeTray>b__1
    Created HWND for the window: 131684
[08:28:15.1149926] [Info] TrayHelper::SetShellIcon
    Could not set the shell icon. Action: Add and error code: -2147467259. HIcon handle is 131721 and HWnd is 131684
[08:28:15.1178852] [Info] <>c__DisplayClass17_0::<RunOnMainThread>b__0
    Thread execution is on: 5
[08:28:15.2223537] [Info] Program::ProcessSettings
    Identified custom time shortcuts for the tray: 0
[08:28:15.2834950] [Info] TrayHelper::SetShellIcon
    Could not set the shell icon. Action: Update and error code: -2147467259. HIcon handle is 66189 and HWnd is 131684
[08:28:15.2839963] [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: -2147467259
[08:28:15.2842521] [Info] Program::HandleCommandLineArguments
    Bound to target process while also using PowerToys settings: 14052

@archipepe
Copy link

Hello, I'm also having this issue with latest v0.85.0

I have to manually disable Awake, wait a few minutes and then reenable it after every restart to load it (Fast startup off).

OS: Windows 11 Pro 24H2 26100.1882 with Windows Feature Experience Pack 1000.26100.23.0

Log_2024-10-03.txt

This is what I found in Event Viewer:

Application: PowerToys.Awake.exe
CoreCLR Version: 8.0.824.36612
.NET Version: 8.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: 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.<>c__DisplayClass20_0.b__0()

@dend
Copy link
Collaborator

dend commented Oct 6, 2024

Something that I am implementing here that will hopefully help in future releases is retry logic for setting the icon. Right now, once it fails once, it fails, but maybe it's worth trying a few more times before giving up. Stay tuned.

@bootlegseahorse
Copy link

Thank you. I figure that it disappears every time I restart Explorer.exe.

@technobulb
Copy link

I am having the same issue. Windows 11 Home

@bootlegseahorse
Copy link

Anybody tried 0.85.1?

@obarannikov
Copy link

Same on 0.85.1

@manuel-garnier
Copy link

Was having same problem with 0.85. Just upgraded to 0.85.1 and it works for now. (Win 11 23H2 22631.4317)

@relu616
Copy link

relu616 commented Oct 16, 2024

Same issue on 0.85.1
Windows 11 Pro 26100.2033 24H2
Windows Feature Experience Pack 1000.26100.23.0
Application: PowerToys.Awake.exe
CoreCLR Version: 8.0.824.36612
.NET Version: 8.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: 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.<>c__DisplayClass20_0.b__0()

@maulonobile
Copy link

maulonobile commented Oct 17, 2024

Same issue on 0.85.1

  • Windows 11 Enterprise 23H2
  • Build 22631.4317
  • Windows Feature Experience Pack 1000.22700.1041.0

@archipepe
Copy link

archipepe commented Oct 19, 2024

Hello,

I'm providing more information. In addition to the .Net error, I found this right after:

Faulting application name: PowerToys.Awake.exe, version: 0.85.1.0, time stamp: 0x66960000
Faulting module name: KERNELBASE.dll, version: 10.0.26100.2152, time stamp: 0x2b014a98
Exception code: 0xe0434352
Fault offset: 0x00000000000c831a
Faulting process id: 0x23E4
Faulting application start time: 0x1DB1F1486EBC05D
Faulting application path: C:\Users\Myuser\AppData\Local\PowerToys\PowerToys.Awake.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: e047c10e-b996-48e9-943c-bbe96be86a74
Faulting package full name:
Faulting package-relative application ID:

I've also noticed that when I resume the computer from Sleep, even though the PowerToys Awake icon is loaded, the computer ignores the "Keep awake indefinitely" setting. I have to change the setting to "Off" and then reselect "Keep awake indefinitely" for it to take effect after every resume. Has anyone else experienced this issue?

Faulting application name: PowerToys.Settings.exe, version: 0.85.1.0, time stamp: 0x66960000
Faulting module name: CoreMessagingXP.dll, version: 10.0.26107.1010, time stamp: 0xd0b1b115
Exception code: 0xc000027b
Fault offset: 0x0000000000093722
Faulting process id: 0x4C8
Faulting application start time: 0x1DB1F1B17E5CD0F
Faulting application path: C:\Users\Myuser\AppData\Local\PowerToys\WinUI3Apps\PowerToys.Settings.exe
Faulting module path: C:\Users\Myuser\AppData\Local\PowerToys\WinUI3Apps\CoreMessagingXP.dll
Report Id: d2b80202-52bd-41db-89f8-a52d733133cf
Faulting package full name:
Faulting package-relative application ID:

@nyoma-diamond
Copy link

I'm also observing this on Windows 11 Pro 23H2.

Windows build 22631.4317
Windows Feature Experience Pack 1000.22700.1041.0
PowerToys v0.85.1
.NET version 8.0.8

Upon collecting bug report logs this is what my (full) log for Awake looks like today (10/23):

[10:30:52.5241875] [Info] Program::Exit
    Awake is already running! Exiting the application.
[10:30:52.5585087] [Info] Manager::SetPassiveKeepAwake
    Operating in passive mode (computer's standard power plan). No custom keep awake settings enabled.
[10:30:52.5610614] [Info] Manager::CancelExistingThread
    Attempting to ensure that the thread is properly cleaned up...
[10:30:52.5619221] [Info] Manager::CancelExistingThread
    Instantiating of new token source and thread token completed.
[10:30:52.5637959] [Info] TrayHelper::SetShellIcon
    Cannot set the shell icon - parent window handle is zero or icon is not available. Text: PowerToys Awake [Passive] Action: Update

As well as this error (excerpt from longer log) a couple days ago (10/20) that mimics what others found above:

...
[10:30:50.1933677] [Info] TrayHelper::SetShellIcon
    Could not set the shell icon. Action: Update and error code: -2147467259. HIcon handle is 66209 and HWnd is 66190
[10:30:50.3222368] [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.<>c__DisplayClass20_0.<HandleCommandLineArguments>b__0()
[10:30:50.3225265] [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.<>c__DisplayClass20_0.<HandleCommandLineArguments>b__0()

@relu616
Copy link

relu616 commented Oct 28, 2024

The problem still existed after installing 24H2. Last week I installed "2024-10 Kumulatives Update für Windows 11 Version 24H2 für x64-basierte Systeme (KB5044384)" and now awake is working.

@archipepe
Copy link

The problem still existed after installing 24H2. Last week I installed "2024-10 Kumulatives Update für Windows 11 Version 24H2 für x64-basierte Systeme (KB5044384)" and now awake is working.

Hello! Not in my case. It seems Awake loads correctly after the first restart of a new build, but after that first restart, it fails to load again. Can you confirm?

@relu616
Copy link

relu616 commented Oct 28, 2024 via email

@rubricae
Copy link

Same Issue Here - Currently running v85.1 on Win11 23H2. This issue has been persistent through the last few versions.
I find that I indeed have to toggle it on & off twice in order for the tray icon to appear, after every system reboot.
Noteworthy that if I close & restart powertoys, then awake will successfully appear on the taskbar.

@relu616
Copy link

relu616 commented Oct 31, 2024

2 of 7 virtual machines show the same effect. Both machines concerned are small and have less apps installed. I assumed that it could be a timing problem at startup. At task in the task scheduler is created to autostart powertoys. I increased the delay in the trigger from 3s to 30 s and it worked. But the task is rewritten or newly created after each startup. Therefore to delete the task and create a new one did not help.

@cmdntfnd
Copy link

cmdntfnd commented Nov 5, 2024

Still happening on 0.86. Need to turn it off and on multiple times to get it to appear on a Microsoft Surface Go 2 tablet. I don't have the problem on my other computer.

@archipepe
Copy link

2 of 7 virtual machines show the same effect. Both machines concerned are small and have less apps installed. I assumed that it could be a timing problem at startup. At task in the task scheduler is created to autostart powertoys. I increased the delay in the trigger from 3s to 30 s and it worked. But the task is rewritten or newly created after each startup. Therefore to delete the task and create a new one did not help.

Hello!

Reading your comment gave me another idea of what I could try.

By disabling the option "Use my sign-in info to automatically finish setting up after an update" from Windows Settings (Accounts → Sign-in options) and waiting a bit before signing in again after restarting, the Awake icon finally loaded correctly. I tried it several times. It seems there is some system service that needs to be started before Awake.

Image

@poeggi
Copy link

poeggi commented Nov 6, 2024

2 of 7 virtual machines show the same effect. Both machines concerned are small and have less apps installed. I assumed that it could be a timing problem at startup. At task in the task scheduler is created to autostart powertoys. I increased the delay in the trigger from 3s to 30 s and it worked. But the task is rewritten or newly created after each startup. Therefore to delete the task and create a new one did not help.

Hello!

Reading your comment gave me another idea of what I could try.

By disabling the option "Use my sign-in info to automatically finish setting up after an update" from Windows Settings (Accounts → Sign-in options) and waiting a bit before signing in again after restarting, the Awake icon finally loaded correctly. I tried it several times. It seems there is some system service that needs to be started before Awake.

Image

This workaround does NOT work for me. Using Windows 11, Powertoys 0.86.0

@pquiring
Copy link

pquiring commented Nov 9, 2024

Still present in v0.86

@kapad
Copy link

kapad commented Nov 17, 2024

I am facing this same issue and can help provide additional debug information. Please let me know what logs and other information I can provide (and how I can gather this information).

@dend
Copy link
Collaborator

dend commented Nov 19, 2024

If you are reporting this issue, please include your logs. I have a hunch as to what might be causing the problem and will have a PR for it this week (effectively, I need to have retry logic for the icon setup).

@relu616
Copy link

relu616 commented Nov 19, 2024

The requested logs.
awake-log_2024-11-19.txt
Log_2024-11-19.txt
settings.json

@kapad
Copy link

kapad commented Nov 19, 2024

If you are reporting this issue, please include your logs. I have a hunch as to what might be causing the problem and will have a PR for it this week (effectively, I need to have retry logic for the icon setup).

How can I gather the necessary logs? I just added a comment because I was facing the same issue, and I'm happy to share whatever logs are necessary, but I may have missed the docs on the steps needed to gather the logs. If you can copy them in here or drop a link, that would be helpful.

@noahcolvin
Copy link

If you are reporting this issue, please include your logs. I have a hunch as to what might be causing the problem and will have a PR for it this week (effectively, I need to have retry logic for the icon setup).

How can I gather the necessary logs? I just added a comment because I was facing the same issue, and I'm happy to share whatever logs are necessary, but I may have missed the docs on the steps needed to gather the logs. If you can copy them in here or drop a link, that would be helpful.

I would assume C:\Users\[username]\AppData\Local\Microsoft\PowerToys\Awake\Logs

@kapad
Copy link

kapad commented Nov 19, 2024

If you are reporting this issue, please include your logs. I have a hunch as to what might be causing the problem and will have a PR for it this week (effectively, I need to have retry logic for the icon setup).

How can I gather the necessary logs? I just added a comment because I was facing the same issue, and I'm happy to share whatever logs are necessary, but I may have missed the docs on the steps needed to gather the logs. If you can copy them in here or drop a link, that would be helpful.

I would assume C:\Users\[username]\AppData\Local\Microsoft\PowerToys\Awake\Logs

Thanks. Will add the logs that are present if I see this problem again when I restart next.

Up until now, it's happened every restart for the past couple of weeks, but last morning when I started my machine I didn't see the issue occur again. (PowerToys version 0.85.0 - but I don't remember updating this too recently, so I don't think anything has changed from when I did see the issue other than a windows system update).

@dend
Copy link
Collaborator

dend commented Nov 19, 2024

Thanks folks. Looking at the logs, I suspect I am right about the root cause. I will work on a PR this week that should address it.

@kapad
Copy link

kapad commented Nov 24, 2024

Thanks. Will add the logs that are present if I see this problem again when I restart next.

This issue hasn't occurred again on my system. And I haven't updated PowerToys either.

@dend - hopefully you have what you need. I don't think I can be of further help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-Awake Issues regarding the PowerToys Awake utility
Projects
None yet
Development

No branches or pull requests