Skip to content

Commit

Permalink
Windows 11 Taskbar Styler v1.1.1 (#302)
Browse files Browse the repository at this point in the history
* Improved parent control matching.
  • Loading branch information
m417z authored Sep 15, 2023
1 parent 8eefc68 commit c8bd45d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mods/windows-11-taskbar-styler.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1355,6 +1355,7 @@ HRESULT InjectWindhawkTAP() noexcept
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.h>

using namespace winrt::Windows::UI::Xaml;
Expand Down Expand Up @@ -1415,8 +1416,10 @@ const std::vector<PropertyKeyValue>* FindElementPropertyOverrides(
bool parentElementMatchFailed = false;

for (const auto& matcher : override.parentElementMatchers) {
// Using parentElementIter.Parent() was sometimes returning null.
parentElementIter =
parentElementIter.Parent().try_as<FrameworkElement>();
Media::VisualTreeHelper::GetParent(parentElementIter)
.try_as<FrameworkElement>();
if (!parentElementIter) {
parentElementMatchFailed = true;
break;
Expand Down

0 comments on commit c8bd45d

Please sign in to comment.