Revert lazy loading Quick Fix UI (#17552)

Turns out, when the branding disables the feature, we try to get
`QuickFixMenu` when it's not loaded, causing a crash in TerminalPage.

Since we end up loading the quick fix menu when we scroll or apply UI
settings, we're actually loading the quick fix menu pretty early on. So
might as well remove the `x:Load="False"`. If we feel strongly about
keeping the lazy loading functionality, we can do that later (and
probably apply the same heuristic to the other XAML we're registering in
TerminalApp).

This also adds a feature flag check when registering the menu in
TerminalApp.

Closes #17548
This commit is contained in:
Carlos Zamora 2024-07-11 17:29:20 -07:00 committed by GitHub
parent ac5b4f5831
commit 7d77160638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View File

@ -1760,12 +1760,15 @@ namespace winrt::TerminalApp::implementation
page->_PopulateContextMenu(weakTerm.get(), sender.try_as<MUX::Controls::CommandBarFlyout>(), true);
}
});
term.QuickFixMenu().Opening([weak = get_weak(), weakTerm](auto&& sender, auto&& /*args*/) {
if (const auto& page{ weak.get() })
{
page->_PopulateQuickFixMenu(weakTerm.get(), sender.try_as<Controls::MenuFlyout>());
}
});
if constexpr (Feature_QuickFix::IsEnabled())
{
term.QuickFixMenu().Opening([weak = get_weak(), weakTerm](auto&& sender, auto&& /*args*/) {
if (const auto& page{ weak.get() })
{
page->_PopulateQuickFixMenu(weakTerm.get(), sender.try_as<Controls::MenuFlyout>());
}
});
}
}
// Method Description:

View File

@ -1286,7 +1286,6 @@
Padding="0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
x:Load="False"
AllowFocusOnInteraction="False"
CornerRadius="0,5,5,0"
PointerEntered="_QuickFixButton_PointerEntered"