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 Updates - NEWKONA_11272024 #36049

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f8c4883
Update with bug fixes for tray icon and support for parent process
dend Aug 15, 2024
e9f8c23
Process information enum
dend Aug 15, 2024
bd07382
Update the docs
dend Aug 15, 2024
8c94795
Fix spelling
dend Aug 15, 2024
708ef51
Make sure that PID is used in PT config flow
dend Aug 19, 2024
594efc6
Merge branch 'microsoft:main' into main
dend Sep 8, 2024
b58398b
Logic for checks based on #34148
dend Sep 8, 2024
524c19a
Update with link to PR
dend Sep 8, 2024
1041203
Fixes #34717
dend Sep 8, 2024
75125f2
Small cleanup
dend Sep 8, 2024
14299ba
Proper task segmentation in a function
dend Sep 8, 2024
3d66e1f
Cleanup the code
dend Sep 9, 2024
83e0be7
Merge branch 'microsoft:main' into main
dend Sep 15, 2024
695b068
Merge branch 'microsoft:main' into main
dend Sep 25, 2024
f02c822
Merge branch 'main' into main
dend Sep 26, 2024
de3c047
Fix synchronization context issue
dend Sep 26, 2024
39bc1d3
Update planning doc
dend Sep 26, 2024
7ca8a2b
Test disabling caching to see if that manages to pass CI
jaimecbernardo Sep 26, 2024
1ff6754
Merge branch 'microsoft:main' into main
dend Sep 27, 2024
c4d7e6d
Cleanup to make sure that we're logging things properly.
dend Sep 27, 2024
ff9b82b
Update ci.yml
dend Sep 27, 2024
95d9336
Disable cache to pass CI
jaimecbernardo Sep 27, 2024
a8bffec
Merge branch 'microsoft:main' into main
dend Nov 22, 2024
21bff77
Retry logic
dend Nov 22, 2024
14e5be8
Merge remote-tracking branch 'origin/main'
dend Nov 22, 2024
d1d8a94
Merge branch 'microsoft:main' into main
dend Nov 27, 2024
cc21240
Cleanup
dend Nov 27, 2024
763a537
Code cleanup
dend Nov 27, 2024
00ad336
Fixes #35848
dend Nov 27, 2024
c6f75b9
Update notes and codename
dend Nov 27, 2024
37f9625
After third attempt, log error instead of throwing exception
dend Nov 27, 2024
9c4abbd
More cleanup to avoid double execution
dend Nov 27, 2024
e35f2b1
Add expected word
dend Nov 27, 2024
c1dcff0
Safeguards for bad values for timed keep-awake
dend Nov 27, 2024
88008ee
More updates to make sure I am using uint
dend Nov 28, 2024
77ca495
Update error message
dend Nov 28, 2024
baf4c5c
Update packages
dend Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/modules/awake/Awake/Core/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System.Text;
using System.Text.Json;
using System.Threading;

using Awake.Core.Models;
using Awake.Core.Native;
using Awake.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using ManagedCommon;

using ManagedCommon;
dend marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
20 changes: 16 additions & 4 deletions src/modules/awake/Awake/Core/TrayHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,24 @@ internal static void SetShellIcon(IntPtr hWnd, string text, Icon? icon, TrayIcon
};
}

if (!Bridge.Shell_NotifyIcon(message, ref _notifyIconData))
for (int attempt = 1; attempt <= 3; attempt++)
{
int errorCode = Marshal.GetLastWin32Error();
Logger.LogInfo($"Could not set the shell icon. Action: {action} and error code: {errorCode}. HIcon handle is {icon?.Handle} and HWnd is {hWnd}");
if (Bridge.Shell_NotifyIcon(message, ref _notifyIconData))
{
break;
}
else
{
int errorCode = Marshal.GetLastWin32Error();
Logger.LogInfo($"Could not set the shell icon. Action: {action}, error code: {errorCode}. HIcon handle is {icon?.Handle} and HWnd is {hWnd}");

if (attempt == 3)
{
throw new Win32Exception(errorCode, $"Failed to change tray icon after 3 attempts. Action: {action} and error code: {errorCode}");
}

throw new Win32Exception(errorCode, $"Failed to change tray icon. Action: {action} and error code: {errorCode}");
Thread.Sleep(100);
dend marked this conversation as resolved.
Show resolved Hide resolved
}
}

if (action == TrayIconAction.Delete)
Expand Down
1 change: 0 additions & 1 deletion src/modules/awake/Awake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

using Awake.Core;
using Awake.Core.Models;
using Awake.Core.Native;
Expand Down
Loading