mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user