From dda5bc51c183bcc72468053e93eb35f3cba70061 Mon Sep 17 00:00:00 2001 From: vladimir11080 Date: Fri, 10 Jan 2020 19:35:28 +0100 Subject: [PATCH 1/2] Fix reversed order of zones in layout --- src/modules/fancyzones/lib/ZoneWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fancyzones/lib/ZoneWindow.cpp b/src/modules/fancyzones/lib/ZoneWindow.cpp index dc354e5d2c08..7bf747c76485 100644 --- a/src/modules/fancyzones/lib/ZoneWindow.cpp +++ b/src/modules/fancyzones/lib/ZoneWindow.cpp @@ -553,7 +553,7 @@ void ZoneWindow::DrawActiveZoneSet(wil::unique_hdc& hdc, RECT const& clientRect) auto zones = m_activeZoneSet->GetZones(); const size_t maxColorIndex = min(size(zones) - 1, size(colors) - 1); size_t colorIndex = maxColorIndex; - for (auto iter = zones.rbegin(); iter != zones.rend(); iter++) + for (auto iter = zones.begin(); iter != zones.end(); iter++) { winrt::com_ptr zone = iter->try_as(); if (!zone) From 1e5da096a4c826ef8e0502acc99547b1ca68ce7e Mon Sep 17 00:00:00 2001 From: vladimir11080 Date: Mon, 13 Jan 2020 19:51:16 +0100 Subject: [PATCH 2/2] Assign window to zones by their displayed priority while dragging --- src/modules/fancyzones/lib/ZoneSet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fancyzones/lib/ZoneSet.cpp b/src/modules/fancyzones/lib/ZoneSet.cpp index 30489d596ff5..6b4b90ec597b 100644 --- a/src/modules/fancyzones/lib/ZoneSet.cpp +++ b/src/modules/fancyzones/lib/ZoneSet.cpp @@ -49,7 +49,7 @@ IFACEMETHODIMP_(winrt::com_ptr) ZoneSet::ZoneFromPoint(POINT pt) noexcept winrt::com_ptr smallestKnownZone = nullptr; // To reduce redundant calculations, we will store the last known zones area. int smallestKnownZoneArea = INT32_MAX; - for (auto iter = m_zones.begin(); iter != m_zones.end(); iter++) + for (auto iter = m_zones.rbegin(); iter != m_zones.rend(); iter++) { if (winrt::com_ptr zone = iter->try_as()) {