From c8bd45d3c8292364a173776354e9909934fb3817 Mon Sep 17 00:00:00 2001 From: Michael Maltsev <4129781+m417z@users.noreply.github.com> Date: Fri, 15 Sep 2023 20:20:26 +0300 Subject: [PATCH] Windows 11 Taskbar Styler v1.1.1 (#302) * Improved parent control matching. --- mods/windows-11-taskbar-styler.wh.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/windows-11-taskbar-styler.wh.cpp b/mods/windows-11-taskbar-styler.wh.cpp index 50ef6c36..f6d3d562 100644 --- a/mods/windows-11-taskbar-styler.wh.cpp +++ b/mods/windows-11-taskbar-styler.wh.cpp @@ -2,7 +2,7 @@ // @id windows-11-taskbar-styler // @name Windows 11 Taskbar Styler // @description An advanced mod to override style attributes of the taskbar control elements -// @version 1.1 +// @version 1.1.1 // @author m417z // @github https://github.com/m417z // @twitter https://twitter.com/m417z @@ -1355,6 +1355,7 @@ HRESULT InjectWindhawkTAP() noexcept #include #include #include +#include #include using namespace winrt::Windows::UI::Xaml; @@ -1415,8 +1416,10 @@ const std::vector* FindElementPropertyOverrides( bool parentElementMatchFailed = false; for (const auto& matcher : override.parentElementMatchers) { + // Using parentElementIter.Parent() was sometimes returning null. parentElementIter = - parentElementIter.Parent().try_as(); + Media::VisualTreeHelper::GetParent(parentElementIter) + .try_as(); if (!parentElementIter) { parentElementMatchFailed = true; break;