From f9a5242e75ffff4044c748446a59956cc319d102 Mon Sep 17 00:00:00 2001 From: Enrico Giordani Date: Fri, 3 Jul 2020 17:04:52 +0200 Subject: [PATCH] [FancyZones] draw active zones on top of inactive zones (#4727) --- src/modules/fancyzones/lib/ZoneWindow.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/fancyzones/lib/ZoneWindow.cpp b/src/modules/fancyzones/lib/ZoneWindow.cpp index ce7007ef96..ee0dbb620e 100644 --- a/src/modules/fancyzones/lib/ZoneWindow.cpp +++ b/src/modules/fancyzones/lib/ZoneWindow.cpp @@ -163,6 +163,7 @@ namespace ZoneWindowDrawUtils isHighlighted[x] = true; } + // First draw the inactive zones for (auto iter = zones.begin(); iter != zones.end(); iter++) { int zoneId = static_cast(iter - zones.begin()); @@ -188,7 +189,19 @@ namespace ZoneWindowDrawUtils DrawZone(hdc, colorViewer, zone, zones, flashMode); } } - else + } + + // Draw the active zones on top of the inactive zones + for (auto iter = zones.begin(); iter != zones.end(); iter++) + { + int zoneId = static_cast(iter - zones.begin()); + winrt::com_ptr zone = iter->try_as(); + if (!zone) + { + continue; + } + + if (isHighlighted[zoneId]) { colorHighlight.fill = highlightColor; colorHighlight.border = zoneBorderColor;