ramensoftware / windhawk-mods

The official collection of Windhawk mods
319 stars 57 forks source link

[Windows 11 Taskbar Styler] Cause Explorer crash when switch virtual desktop #354

Open clover-yan opened 1 year ago

clover-yan commented 1 year ago

Windows 11 Taskbar Styler by @m417z

When switch virtual desktop, Explorer may randomly crash and restart.

I use Windows 11 22H2 22621.2134, with StartAllBack using. Disabling it and all other mods didn't help.

My mod settings ```json {"resourceVariables[0].variableKey":"TaskbarContextMenuMargin","resourceVariables[0].value":"0","promptForExplorerRestart":"1","controlStyles[0].target":"taskbar:TaskListButtonPanel > Border#BackgroundElement","controlStyles[0].styles[0]":"Background=black"} ```
Log from Event Viewer ```xml 日志名称: Application 来源: Application Error 日期: 2023/11/1 16:57:08 事件 ID: 1000 任务类别: 应用程序崩溃事件 级别: 错误 关键字: 用户: DESKTOP-0U8LNJD\seewo 计算机: DESKTOP-0U8LNJD 描述: 错误应用程序名称: explorer.exe,版本: 10.0.22621.2070,时间戳: 0x2bd7252c 错误模块名称: Windows.UI.Xaml.dll,版本: 10.0.22621.2070,时间戳: 0xa1d6b8fe 异常代码: 0xc0000005 错误偏移量: 0x0000000000343080 错误进程 ID: 0x0x39D0 错误应用程序启动时间: 0x0x1DA0C9FE7548377 错误应用程序路径: C:\WINDOWS\explorer.exe 错误模块路径: C:\Windows\System32\Windows.UI.Xaml.dll 报告 ID: b92d8a24-9a70-4315-8d52-c153516967cf 错误程序包全名: 错误程序包相对应用程序 ID: 事件 Xml: 1000 0 2 100 0 0x8000000000000000 11732 Application DESKTOP-0U8LNJD explorer.exe 10.0.22621.2070 2bd7252c Windows.UI.Xaml.dll 10.0.22621.2070 a1d6b8fe c0000005 0000000000343080 0x39d0 0x1da0c9fe7548377 C:\WINDOWS\explorer.exe C:\Windows\System32\Windows.UI.Xaml.dll b92d8a24-9a70-4315-8d52-c153516967cf ```
m417z commented 1 year ago

I couldn't reproduce it. Please post debug logs.

clover-yan commented 1 year ago

Dear @m417z,

I followed your steps above and made sure that there was no issue when the mod is disabled, and had issue when the mod is enabled.

I also noticed that the issue is not only happened when I switch virtual desktop; sometimes the issue happens when I just click on the taskbar.

Also, I found that TranslucentTB causes this problem as well. It might be problem of my OS, but sfc /scannow didn't help.

Here is the log. Thank you for your help.

log.txt

m417z commented 1 year ago

Looks like it crashes after trying to apply the border style in a loop (taskbar:TaskListButtonPanel > Border#BackgroundElement). I suspect that the mod may conflict with TranslucentTB which also tries to customize the border style.

clover-yan commented 1 year ago

Looks like it crashes after trying to apply the border style in a loop (taskbar:TaskListButtonPanel > Border#BackgroundElement). I suspect that the mod may conflict with TranslucentTB which also tries to customize the border style.

@m417z Thank you for your reply. I turned off TranslucentTB, but the issue still remains. I thought that there're other programs which conflicts with the mod. I'd appreciate if you could inform me about how to find it/them out. Thank you for your help.

m417z commented 1 year ago

Unfortunately I don't have an answer, but if you find out, please share your findings.

m417z commented 11 months ago

Please try Windows 11 Taskbar Styler v1.2, I changed several things, perhaps it caused the issue to be fixed.

clover-yan commented 10 months ago

@m417z I apologize for the delayed response. Unfortunately, I tried the latest version but the issue still exists. I think it might be my computer to blame. Thank you very much for your patience.

lichenophile commented 2 days ago

I seem to have this issue also, reproducible by simply enabling windows 11 taskbar styler with theme set to none, all other windhawk mods disabled

The fastest path to crash seems to be:

  1. switch 'virtual' desktops
  2. switch back
  3. open a new explorer window This almost always crashes the taskbar, though sometimes it takes up to a minute or requires a second round through the above

The default config when theme is none:

{"theme":"","controlStyles[0].target":"","controlStyles[0].styles[0]":"","resourceVariables[0].variableKey":"","resourceVariables[0].value":""}

I also tried removing the blank target and styles via the ui, still crashes

Possible conflicts:

ExplorerPatcher Version 22621.4317.67.1 I run pretty much windows default settings for taskbar in EP so hopefully it isn't the problem. image

Rose Pine for Windows 11 by niivu No clue if this could be involved but I'll list it just in case

Windows version info:

Edition     ‎Windows 11 Pro
Version ‎   ‎23H2
Installed on    ‎22/‎12/‎2023
OS build    ‎22631.4460
Experience  Windows Feature Experience Pack 1000.22700.1047.0

I also tried updating to the following offered version, with the problem remaining:

Edition ‎   Windows 11 Pro
Version ‎   23H2
Installed on    ‎22/‎12/‎2023
OS build    22631.4541
Experience  Windows Feature Experience Pack 1000.22700.1055.0
m417z commented 2 days ago

Thanks for the additional details @lichenophile. I was able to reproduce this problem a while ago. I tried to find a workaround for it, but without success.

Relevant issues:

From one of the issues above:

It's nothing specific to the mod, I was able to reproduce the crash with a modified version of the mod with most functionality removed, and also with UWPSpy. It seems to be a Windows bug in the UI inspection mechanism. I believe that other tools that use this mechanism, such as TranslucentTB, trigger the bug as well, but I didn't try it.