@@ -104,31 +104,8 @@ bool AddZone(Zone zone, ZonesMap& zones) noexcept
104104 return true ;
105105}
106106
107- int AdjustSpacingForRegistry (int originalSpacing)
108- {
109- // Check Windows DWM ColorPrevalence setting
110- // When ColorPrevalence = 0 (accent color not shown), subtract 1 from spacing
111- HKEY hKey;
112- DWORD dwValue = 1 ; // Default to 1 (accent color shown)
113- DWORD dwSize = sizeof (DWORD );
114-
115- if (RegOpenKeyExW (HKEY_CURRENT_USER , L" Software\\ Microsoft\\ Windows\\ DWM" , 0 , KEY_READ , &hKey) == ERROR_SUCCESS )
116- {
117- RegQueryValueExW (hKey, L" ColorPrevalence" , nullptr , nullptr , reinterpret_cast <LPBYTE >(&dwValue), &dwSize);
118- RegCloseKey (hKey);
119- }
120-
121- // Apply -1 margin when ColorPrevalence = 0 (accent color not shown)
122- if (dwValue == 0 )
123- {
124- return originalSpacing - 1 ;
125- }
126- return originalSpacing;
127- }
128-
129107ZonesMap CalculateGridZones (FancyZonesUtils::Rect workArea, FancyZonesDataTypes::GridLayoutInfo gridLayoutInfo, int spacing)
130108{
131- spacing = AdjustSpacingForRegistry (spacing);
132109 ZonesMap zones;
133110
134111 long totalWidth = workArea.width ();
@@ -262,7 +239,6 @@ ZonesMap LayoutConfigurator::Rows(FancyZonesUtils::Rect workArea, int zoneCount,
262239 return {};
263240 }
264241
265- spacing = AdjustSpacingForRegistry (spacing);
266242 ZonesMap zones;
267243
268244 long totalWidth = workArea.width () - (spacing * 2 );
@@ -309,7 +285,6 @@ ZonesMap LayoutConfigurator::Columns(FancyZonesUtils::Rect workArea, int zoneCou
309285 return {};
310286 }
311287
312- spacing = AdjustSpacingForRegistry (spacing);
313288 ZonesMap zones;
314289
315290 long totalWidth = workArea.width () - (spacing * (zoneCount + 1 ));
@@ -356,8 +331,6 @@ ZonesMap LayoutConfigurator::Grid(FancyZonesUtils::Rect workArea, int zoneCount,
356331 return {};
357332 }
358333
359- spacing = AdjustSpacingForRegistry (spacing);
360-
361334 int rows = 1 , columns = 1 ;
362335 while (zoneCount / rows >= rows)
363336 {
@@ -415,8 +388,6 @@ ZonesMap LayoutConfigurator::PriorityGrid(FancyZonesUtils::Rect workArea, int zo
415388 return {};
416389 }
417390
418- spacing = AdjustSpacingForRegistry (spacing);
419-
420391 constexpr int predefinedLayoutsCount = sizeof (predefinedPriorityGridLayouts) / sizeof (FancyZonesDataTypes::GridLayoutInfo);
421392 if (zoneCount < predefinedLayoutsCount)
422393 {
@@ -428,8 +399,6 @@ ZonesMap LayoutConfigurator::PriorityGrid(FancyZonesUtils::Rect workArea, int zo
428399
429400ZonesMap LayoutConfigurator::Custom (FancyZonesUtils::Rect workArea, HMONITOR monitor, const FancyZonesDataTypes::CustomLayoutData& zoneSet, int spacing) noexcept
430401{
431- spacing = AdjustSpacingForRegistry (spacing);
432-
433402 if (zoneSet.type == FancyZonesDataTypes::CustomLayoutType::Canvas && std::holds_alternative<FancyZonesDataTypes::CanvasLayoutInfo>(zoneSet.info ))
434403 {
435404 ZonesMap zones;
0 commit comments