[FancyZones] Fix deadlocks in ZoneWindowDrawing (#10461)

* Fixed deadlocks in ZoneWindowDrawing

Moved all possibly reentrant or blocking calls to ShowWindow out of critical sections.

* Initialize bools

* Tune flashing visuals

* Address PR comments

* Use  = true; to initialize bools
* Remove tracing from GetAnimationAlpha
* Use member initialization when constructing AnimationInfo

* Refactor rendering

* Whitespace

* Hide window on render failure
This commit is contained in:
Ivan Stošić
2021-03-29 13:39:16 +02:00
committed by GitHub
parent ccc380f11c
commit 31fa9475da
4 changed files with 80 additions and 67 deletions

View File

@@ -163,8 +163,6 @@ private:
std::vector<size_t> m_highlightZone;
WPARAM m_keyLast{};
size_t m_keyCycle{};
static const UINT m_showAnimationDuration = 200; // ms
static const UINT m_flashDuration = 1000; // ms
std::unique_ptr<ZoneWindowDrawing> m_zoneWindowDrawing;
};
@@ -384,7 +382,7 @@ ZoneWindow::ShowZoneWindow() noexcept
{
SetAsTopmostWindow();
m_zoneWindowDrawing->DrawActiveZoneSet(m_activeZoneSet->GetZones(), m_highlightZone, m_host);
m_zoneWindowDrawing->Show(m_showAnimationDuration);
m_zoneWindowDrawing->Show();
}
}
@@ -428,7 +426,7 @@ ZoneWindow::FlashZones() noexcept
{
SetAsTopmostWindow();
m_zoneWindowDrawing->DrawActiveZoneSet(m_activeZoneSet->GetZones(), {}, m_host);
m_zoneWindowDrawing->Flash(m_flashDuration);
m_zoneWindowDrawing->Flash();
}
}