JasonWei512 / EnergyStarX

🔋 Improve your Windows 11 device's battery life. A WinUI 3 GUI for https://github.com/imbushuo/EnergyStar.
https://www.microsoft.com/store/productId/9NF7JTB3B17P
GNU General Public License v3.0
906 stars 19 forks source link

The app crashes when the cursor is hovered over it​ #36

Closed NJinsei closed 1 year ago

NJinsei commented 1 year ago

Description / 描述

When the app is minimised for a while and the mouse is hovered over it, it cause the app and also seems to cause other UWP apps that are minimised in task to crash as well. (Magicpods)

Reproduction steps / 复现步骤

  1. Have the app be minimised
  2. Use the device normally for a few minutes
  3. Hover cursor over the task

Windows version / Windows 版本

Edition Windows 11 Home Version 22H2 Installed on ‎01/‎10/‎2022 OS build 22621.1105 Experience Windows Feature Experience Pack 1000.22638.1000.0

Hardware specs / 硬件配置

Device name FlowX16 Processor AMD Ryzen 9 6900HS with Radeon Graphics 3.30 GHz Installed RAM 32.0 GB (31.3 GB usable) System type 64-bit operating system, x64-based processor Pen and touch Pen and touch support with 10 touch points

Error log / 错误日志

2022-11-25 17:48:38.9251|ERROR|EnergyStarX.App|Unhandled and unrecoverable exception|System.InvalidOperationException: UpdateIcon failed. at H.NotifyIcon.Core.TrayIcon.UpdateIcon(IntPtr handle) in /_/src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 359 at EnergyStarX.Services.SystemTrayIconService.UpdateTrayIconImageAndToolTip() at CommunityToolkit.WinUI.DispatcherQueueExtensions.<>cDisplayClass0_0.b__1() --- End of stack trace from previous location --- at EnergyStarX.Services.SystemTrayIconService.RunOnUIThread(Action action) at EnergyStarX.Services.SystemTrayIconService.EnergyService_StatusChanged(Object sender, EnergyStatus e) at System.Threading.Tasks.Task.<>c.b1281(Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() 2022-11-29 19:23:22.9429|ERROR|EnergyStarX.App|Unhandled and unrecoverable exception|System.InvalidOperationException: UpdateIcon failed. at H.NotifyIcon.Core.TrayIcon.UpdateIcon(IntPtr handle) in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 359 at EnergyStarX.Services.SystemTrayIconService.UpdateTrayIconImageAndToolTip() at CommunityToolkit.WinUI.DispatcherQueueExtensions.<>cDisplayClass0_0.b__1() --- End of stack trace from previous location --- at EnergyStarX.Services.SystemTrayIconService.RunOnUIThread(Action action) at EnergyStarX.Services.SystemTrayIconService.EnergyService_StatusChanged(Object sender, EnergyStatus e) at System.Threading.Tasks.Task.<>c.b1281(Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() 2022-12-01 17:52:31.9087|ERROR|EnergyStarX.App|Unhandled and unrecoverable exception|System.InvalidOperationException: UpdateIcon failed. at H.NotifyIcon.Core.TrayIcon.UpdateIcon(IntPtr handle) in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 359 at EnergyStarX.Services.SystemTrayIconService.UpdateTrayIconImageAndToolTip() at CommunityToolkit.WinUI.DispatcherQueueExtensions.<>cDisplayClass0_0.b__1() --- End of stack trace from previous location --- at EnergyStarX.Services.SystemTrayIconService.RunOnUIThread(Action action) at EnergyStarX.Services.SystemTrayIconService.EnergyService_StatusChanged(Object sender, EnergyStatus e) at System.Threading.Tasks.Task.<>c.b1281(Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() 2022-12-05 03:29:24.0911|ERROR|EnergyStarX.App|Unhandled and unrecoverable exception|System.InvalidOperationException: UpdateIcon failed. at H.NotifyIcon.Core.TrayIcon.UpdateIcon(IntPtr handle) in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 359 at EnergyStarX.Services.SystemTrayIconService.UpdateTrayIconImageAndToolTip() at CommunityToolkit.WinUI.DispatcherQueueExtensions.<>cDisplayClass0_0.b__1() --- End of stack trace from previous location --- at EnergyStarX.Services.SystemTrayIconService.RunOnUIThread(Action action) at EnergyStarX.Services.SystemTrayIconService.EnergyService_StatusChanged(Object sender, EnergyStatus e) at System.Threading.Tasks.Task.<>c.b1281(Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() 2022-12-09 19:10:22.9135|ERROR|EnergyStarX.Services.SystemTrayIconService|Caught exception thrown by trayIcon.UpdateIcon()|System.InvalidOperationException: UpdateIcon failed. at H.NotifyIcon.Core.TrayIcon.UpdateIcon(IntPtr handle) in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 359 at EnergyStarX.Services.SystemTrayIconService.UpdateTrayIconImageAndToolTip(Boolean isThrottling) 2022-12-09 19:10:22.9601|ERROR|EnergyStarX.Services.SystemTrayIconService|Caught exception thrown by trayIcon.UpdateToolTip()|System.InvalidOperationException: UpdateToolTip failed. at H.NotifyIcon.Core.TrayIcon.UpdateToolTip(String text) in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 335 at EnergyStarX.Services.SystemTrayIconService.UpdateTrayIconImageAndToolTip(Boolean isThrottling) 2023-01-11 21:24:14.8770|ERROR|EnergyStarX.App|Unhandled and unrecoverable exception|System.InvalidOperationException: TryCreate failed. at H.NotifyIcon.Core.TrayIcon.Create() in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 226 at H.NotifyIcon.Core.TrayIconWithContextMenu.b__150() in //src/libs/H.NotifyIcon/PopupMenus/TrayIconWithContextMenu.cs:line 56

JasonWei512 commented 1 year ago

Do you mean the system tray icon? image

Are you using some taskbar enhancement tool like StartAllBack? See: https://github.com/JasonWei512/EnergyStarX/issues/7#issuecomment-1279691880

Are you using the latest version (1.0.4)?

NJinsei commented 1 year ago

I am talking about the system icon, not using any enhancements, and I am using the latest version.

JasonWei512 commented 1 year ago

Could you record a video?

NJinsei commented 1 year ago

Alright I'll try to get it when it happens next

NJinsei commented 1 year ago

It's difficult to record as when it happens it is quite random but infrequent. But what happens is that as soon as the mouse is hovered over it all UWP apps seem to crash and they disappears from the expanded task bar. Requiring the user to open the app again.