ramensoftware / windhawk-mods

The official collection of Windhawk mods
294 stars 53 forks source link

[Windows 11 Taskbar Styler] Acrylic taskbar effect reverts to solid color when waking monitors from sleep #1146

Open gubsy420 opened 4 days ago

gubsy420 commented 4 days ago

This issue has been happening for a while, and while I do not believe this is the only trigger, it is one that I can reproduce. I am using a slightly modified Docklike theme and have the taskbar background color set to the acrylic effect. Whenever I wake up monitors after they are turned off via my windows power settings timer, the acryllic effect reverts to solid black, with no transparency.

With acrylic effect: Screenshot 2024-10-25 234949

After the bug happens: Screenshot 2024-10-25 234732

Below is my configuration. The only other mod I have installed is Taskbar height and icon size. As far as other theming apps, the only thing beside windhawk that I have installed is Wallpaper Engine, which I have added to the exclusion list of windhawk but the bug continues to occur.

{
  "controlStyles[0].target": "Taskbar.TaskbarFrame#TaskbarFrame",
  "controlStyles[0].styles[0]": "Width=Auto",
  "controlStyles[0].styles[1]": "HorizontalAlignment=Center",
  "controlStyles[0].styles[2]": "Margin=50,0,50,0",
  "controlStyles[1].target": "Taskbar.TaskbarFrame#TaskbarFrame > Grid#RootGrid",
  "controlStyles[1].styles[0]": "Background:=<AcrylicBrush TintColor=\"{ThemeResource SystemChromeAltHighColor}\" TintOpacity=\"0.3\" FallbackColor=\"{ThemeResource SystemChromeLowColor}\" />",
  "controlStyles[1].styles[1]": "Padding=6,0,6,0",
  "controlStyles[1].styles[2]": "CornerRadius=8",
  "controlStyles[1].styles[3]": "BorderBrush:=<SolidColorBrush Color=\"{ThemeResource SurfaceStrokeColorDefault}\" />",
  "controlStyles[1].styles[4]": "Margin=-0,3,0,6",
  "controlStyles[2].target": "Rectangle#BackgroundFill",
  "controlStyles[2].styles[0]": "Visibility=Collapsed",
  "controlStyles[3].target": "Rectangle#BackgroundStroke",
  "controlStyles[3].styles[0]": "Visibility=Collapsed",
  "controlStyles[4].target": "Taskbar.AugmentedEntryPointButton#AugmentedEntryPointButton > Taskbar.TaskListButtonPanel#ExperienceToggleButtonRootPanel",
  "controlStyles[4].styles[0]": "Margin=0",
  "controlStyles[5].target": "Grid#SystemTrayFrameGrid",
  "controlStyles[5].styles[0]": "Background:=<AcrylicBrush TintColor=\"{ThemeResource SystemChromeAltHighColor}\" TintOpacity=\"0.3\" FallbackColor=\"{ThemeResource SystemChromeLowColor}\" />",
  "controlStyles[5].styles[1]": "Margin=-0,3,0,6",
  "controlStyles[5].styles[2]": "CornerRadius=8",
  "controlStyles[5].styles[3]": "BorderThickness=12,12,12,12",
  "controlStyles[5].styles[4]": "BackgroundSizing=InnerBorderEdge",
  "controlStyles[6].target": "SystemTray.ChevronIconView",
  "controlStyles[6].styles[0]": "Padding=0",
  "controlStyles[7].target": "SystemTray.NotifyIconView#NotifyItemIcon",
  "controlStyles[7].styles[0]": "Padding=0",
  "controlStyles[8].target": "SystemTray.OmniButton",
  "controlStyles[8].styles[0]": "Padding=0",
  "controlStyles[9].target": "SystemTray.CopilotIcon",
  "controlStyles[9].styles[0]": "Padding=0",
  "controlStyles[10].target": "SystemTray.OmniButton#NotificationCenterButton > Grid > ContentPresenter > ItemsPresenter > StackPanel > ContentPresenter > systemtray:IconView#SystemTrayIcon > Grid",
  "controlStyles[10].styles[0]": "Padding=4,0,4,0",
  "controlStyles[11].target": "SystemTray.IconView#SystemTrayIcon > Grid#ContainerGrid > ContentPresenter#ContentPresenter > Grid#ContentGrid > SystemTray.TextIconContent > Grid#ContainerGrid",
  "controlStyles[11].styles[0]": "Padding=0",
  "controlStyles[12].target": "SystemTray.StackListView#IconStack > ItemsPresenter > StackPanel > ContentPresenter > SystemTray.IconView#SystemTrayIcon",
  "controlStyles[12].styles[0]": "Padding=0",
  "controlStyles[13].target": "SystemTray.Stack#ShowDesktopStack",
  "controlStyles[13].styles[0]": "Margin=0,-4,-12,-4",
  "controlStyles[14].target": "Taskbar.Gripper#GripperControl",
  "controlStyles[14].styles[0]": "Width=Auto",
  "controlStyles[14].styles[1]": "MinWidth=24"
}
m417z commented 4 days ago

The mod doesn't handle the acrylic styles, it creates the relevant objects (e.g. <AcrylicBrush ...>) with Windows APIs, and sets them as properties of the relevant targets. From there, Windows handles it, including stuff like when to use FallbackColor instead of acrylic. Given all that, I'm not sure that the behavior is related to the mod, and that the mod can or should fix it.

Is there a way to restore the acrylic style? I assume that a restart fixes it, what about restarting explorer? Changing themes? Maybe connecting to a charger if it's a laptop? This can give us a hint as of why that happens, and perhaps a workaround.

gubsy420 commented 4 days ago

The mod doesn't handle the acrylic styles, it creates the relevant objects (e.g. <AcrylicBrush ...>) with Windows APIs, and sets them as properties of the relevant targets. From there, Windows handles it, including stuff like when to use FallbackColor instead of acrylic. Given all that, I'm not sure that the behavior is related to the mod, and that the mod can or should fix it.

Is there a way to restore the acrylic style? I assume that a restart fixes it, what about restarting explorer? Changing themes? Maybe connecting to a charger if it's a laptop? This can give us a hint as of why that happens, and perhaps a workaround.

Typically, restarting windhawk will restore the acrylic, but sometimes it is necessary to restart explorer entirely. Changing themes doesn't seem to really make any difference. The PC is a desktop, so battery saver mode isn't a concern; I did read about that nuance of a acrylic. I can also confirm that transparency effects are indeed turned on. One thing I just tried was getting rid of the manual installation of the theme, and have instead selected it via the drop down and made the color and style adjustments from within the UI, using that target and style boxes. I haven't had the issue happen since then, but sometimes it'll not happen for a day or two and then all of a sudden happen so we will see.