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

[Windows 11 Taskbar Styler] Minimize/restore malfunction on 2nd monitor #1141

Open
immortalx74 opened this issue Oct 25, 2024 · 5 comments
Open
Labels
mod-bug Something isn't working with a mod

Comments

@immortalx74
Copy link

@https://github.com/m417z

NOTE: This issue only happens on the taskbar of the 2nd monitor!

When the mod in enabled, the Windows feature of clicking an open app in the taskbar to minimize/restore, sometimes needs 4 or 5 clicks to work. I can't reproduce it consistently, but it seems it is triggered when you have a couple of apps open and try to minimize/restore them interchangeably a couple of times.

I made sure to stop the debug logging right after the issue was triggered. Hope that helps and thank you for this awesome mod!
debug.txt

@immortalx74 immortalx74 added the mod-bug Something isn't working with a mod label Oct 25, 2024
@m417z
Copy link
Member

m417z commented Oct 25, 2024

Does it happen when no styles are used? If not, can you find out which style causes it?

@immortalx74
Copy link
Author

immortalx74 commented Oct 25, 2024

You're right, it seems to be the style. I use a custom one based on other styles. Here it is:

{
	"controlStyles[0].target": "Rectangle#BackgroundFill",
	"controlStyles[0].styles[0]": "Fill:=<AcrylicBrush TintColor=\"Black\" TintOpacity=\"0\" TintLuminosityOpacity=\"0.15\" Opacity=\"1\" FallbackColor=\"#702626AA\"/>",
	"controlStyles[1].target": "Rectangle#BackgroundStroke",
	"controlStyles[1].styles[0]": "Visibility=Collapsed",
	"controlStyles[2].target": "MenuFlyoutPresenter",
	"controlStyles[2].styles[0]": "Background:=<AcrylicBrush TintColor=\"Black\" TintOpacity=\"0\" TintLuminosityOpacity=\"0.12\" Opacity=\"1\" FallbackColor=\"#A0262626\"/>",
	"controlStyles[2].styles[1]": "BorderThickness=0,0,0,0",
	"controlStyles[2].styles[2]": "CornerRadius=14",
	"controlStyles[2].styles[3]": "Padding=3,4,3,4",
	"controlStyles[3].target": "Border#OverflowFlyoutBackgroundBorder",
	"controlStyles[3].styles[0]": "Background:=<AcrylicBrush TintColor=\"Black\" TintOpacity=\"0\" TintLuminosityOpacity=\"0.12\" Opacity=\"1\" FallbackColor=\"#A0262626\"/>",
	"controlStyles[3].styles[1]": "BorderThickness=0,0,0,0",
	"controlStyles[3].styles[2]": "CornerRadius=15",
	"controlStyles[3].styles[3]": "Margin=-2,-2,-2,-2",
	"controlStyles[4].target": "Taskbar.TaskListLabeledButtonPanel@RunningIndicatorStates > Rectangle#RunningIndicator",
	"controlStyles[4].styles[0]": "Height=3",
	"controlStyles[4].styles[1]": "Width@ActiveRunningIndicator=30",
	"controlStyles[4].styles[2]": "Width@InactiveRunningIndicator=8",
	"controlStyles[4].styles[3]": "Fill@ActiveRunningIndicator=#DDDDDD",
	"controlStyles[4].styles[4]": "Fill@InactiveRunningIndicator=#DDDDDD",
	"controlStyles[5].target": "Taskbar.TaskbarFrame#TaskbarFrame > Grid#RootGrid",
	"controlStyles[5].styles[0]": "CornerRadius=18,18,18,18",
	"controlStyles[5].styles[1]": "BorderBrush:=<SolidColorBrush Color=\"{ThemeResource SurfaceStrokeColorDefault}\" />",
	"controlStyles[6].target": "Taskbar.TaskListLabeledButtonPanel@CommonStates > Border#BackgroundElement",
	"controlStyles[6].styles[0]": "Background@ActivePointerOver=#55550099",
	"controlStyles[6].styles[1]": "Background@InactivePointerOver=#55550099"
  }

@m417z
Copy link
Member

m417z commented Oct 25, 2024

Can you find out which one of the 7 targets causes the issue? And which style?

@immortalx74
Copy link
Author

I think I found it. Removing this line:
"controlStyles[5].styles[1]": "BorderBrush:=<SolidColorBrush Color=\"{ThemeResource SurfaceStrokeColorDefault}\" />"
or even just changing the Color with a "named" color (eg Red), instead of using ThemeResource SurfaceStrokeColorDefault, fixes the issue.

@m417z
Copy link
Member

m417z commented Oct 26, 2024

Interesting. The mod doesn't interpret the XAML, it uses Windows APIs to have it parsed and converted to an object. It looks like a Windows bug, perhaps the ThemeResource resolving is an extra asynchronous task which interferes with click events.

I'm not sure what can be done about it on the mod side, but let's keep this issue as a reference in case others encounter a similar problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod-bug Something isn't working with a mod
Projects
None yet
Development

No branches or pull requests

2 participants