Skip to content

Remove tiling gaps by default in FancyZones #40037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 13, 2025

Changes the default spacing between tiled windows from 16 pixels to 0 pixels, eliminating gaps by default as requested by users who prefer traditional tiling window manager behavior.

Changes Made

  1. Updated default spacing value

    • Changed DefaultValues::Spacing from 16 to 0 in LayoutDefaults.h
    • This affects all new layouts created with default settings
  2. Improved code consistency

    • Updated isLayoutDefault() function in AppliedLayouts.cpp to use DefaultValues constants instead of hardcoded values
    • Ensures the function correctly identifies layouts using the new default spacing
    • Makes the code more maintainable for future default value changes

Behavior Changes

  • Before: New FancyZones layouts had 16px gaps between windows by default
  • After: New FancyZones layouts have no gaps between windows by default
  • Users can still enable spacing in the FancyZones editor if desired
  • Existing layouts and user preferences are preserved
  • JSON parsing of existing configurations continues to work correctly

Testing

  • Verified that default layouts now use 0 spacing
  • Confirmed that isLayoutDefault() correctly identifies new default layouts
  • Ensured backward compatibility with existing configurations
  • All existing unit tests for JSON parsing functionality remain valid

This change addresses user feedback requesting the removal of default tiling gaps to match the behavior of traditional Linux tiling window managers.

Fixes #21872.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits June 13, 2025 19:10
…aps by default

Co-authored-by: crutkas <1462282+crutkas@users.noreply.github.com>
…coded values

Co-authored-by: crutkas <1462282+crutkas@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] No tiling gaps by default Remove tiling gaps by default in FancyZones Jun 13, 2025
@Copilot Copilot AI requested a review from crutkas June 13, 2025 19:14
Copilot finished work on behalf of crutkas June 13, 2025 19:14
@crutkas
Copy link
Member

crutkas commented Jun 13, 2025

is the issue, i provide a regkey i need to actively be verified. based on that reg key, when true, we should subtract -1 to the margin.

Copy link
Contributor Author

Copilot AI commented Jun 13, 2025

is the issue, i provide a regkey i need to actively be verified. based on that reg key, when true, we should subtract -1 to the margin.

Could you clarify which specific registry key you'd like me to check? I see that PowerToys uses the GPO system for registry policies, but I'm not sure which key you're referring to for the margin adjustment functionality. Should I create a new registry key for this purpose, or is there an existing one I should use?

is the issue, i provide a regkey i need to actively be verified. based on that reg key, when true, we should subtract -1 to the margin.

I've implemented the registry key functionality for margin adjustment. Added registry key FancyZonesAdjustMargin that, when set to 1 (enabled), subtracts 1 pixel from spacing/margin values in all FancyZones layout calculations. The implementation follows PowerToys GPO policy patterns and is applied to all layout types (Grid, PriorityGrid, Rows, Columns, Custom). Commit: 0f4630e

@crutkas
Copy link
Member

crutkas commented Jun 13, 2025

when set to 0, i need the additional -1 margin applied

HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM

Look for the value: ColorPrevalence (Type: REG_DWORD)
1 = Accent color is shown on title bars and window borders
0 = Accent color is not shown

Co-authored-by: crutkas <1462282+crutkas@users.noreply.github.com>
Copilot finished work on behalf of crutkas June 13, 2025 20:55
Co-authored-by: crutkas <1462282+crutkas@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 13, 2025

when set to 0, i need the additional -1 margin applied

HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM
...

Updated the implementation to use the Windows DWM ColorPrevalence registry key as requested. Now checks HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorPrevalence and applies -1 margin when the value is 0 (accent color not shown). Commit: 877941a

Copilot finished work on behalf of crutkas June 13, 2025 21:02
@crutkas
Copy link
Member

crutkas commented Jun 18, 2025

tested, no gap :)

@crutkas crutkas marked this pull request as ready for review June 18, 2025 19:30
@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Review This Pull Request awaits the review of a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No tiling gaps by default
2 participants