this fixes the weird lock that we really really don't need anymore
This commit is contained in:
parent
8c7ce77811
commit
7c288517a5
|
@ -187,7 +187,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
}
|
||||
});
|
||||
|
||||
// TODO! uh, this feels wrong aren't we just setting this above??
|
||||
UpdateSettings(settings, unfocusedAppearance);
|
||||
}
|
||||
|
||||
|
@ -588,7 +587,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
// - INVARIANT: This method can only be called if the caller DOES NOT HAVE writing lock on the terminal.
|
||||
void ControlCore::UpdateSettings(const IControlSettings& settings, const IControlAppearance& newAppearance)
|
||||
{
|
||||
std::unique_lock l{ _settingsLock };
|
||||
_settings = winrt::make_self<implementation::ControlSettings>(settings, newAppearance);
|
||||
|
||||
auto lock = _terminal->LockForWriting();
|
||||
|
|
|
@ -58,13 +58,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
|
||||
void UpdateSettings(const Control::IControlSettings& settings, const IControlAppearance& newAppearance);
|
||||
void ApplyAppearance(const bool& focused);
|
||||
Control::IControlSettings Settings()
|
||||
{
|
||||
// TODO! This prevents a crash when sliding the opacity slider
|
||||
// quickly, but it feels stupid.
|
||||
auto l = std::unique_lock<til::ticket_lock>{ _settingsLock };
|
||||
return *_settings;
|
||||
};
|
||||
Control::IControlSettings Settings() { return *_settings; };
|
||||
Control::IControlAppearance FocusedAppearance() const { return *_settings->FocusedAppearance(); };
|
||||
Control::IControlAppearance UnfocusedAppearance() const { return *_settings->UnfocusedAppearance(); };
|
||||
bool HasUnfocusedAppearance() const;
|
||||
|
@ -210,7 +204,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
TerminalConnection::ITerminalConnection::StateChanged_revoker _connectionStateChangedRevoker;
|
||||
|
||||
winrt::com_ptr<ControlSettings> _settings{ nullptr };
|
||||
til::ticket_lock _settingsLock;
|
||||
|
||||
std::unique_ptr<::Microsoft::Terminal::Core::Terminal> _terminal{ nullptr };
|
||||
|
||||
|
|
|
@ -242,13 +242,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
{
|
||||
auto weakThis{ get_weak() };
|
||||
|
||||
co_await winrt::resume_background();
|
||||
_core.UpdateSettings(settings, unfocusedAppearance);
|
||||
|
||||
// Dispatch a call to the UI thread to apply the new settings to the
|
||||
// terminal.
|
||||
co_await winrt::resume_foreground(Dispatcher());
|
||||
|
||||
_core.UpdateSettings(settings, unfocusedAppearance);
|
||||
|
||||
_UpdateSettingsFromUIThread();
|
||||
|
||||
_UpdateAppearanceFromUIThread(_focused ? _core.FocusedAppearance() : _core.UnfocusedAppearance());
|
||||
|
|
Loading…
Reference in a new issue