8000 feat: add aspect_ratio window rule for floating windows by Ssnibles · Pull Request #1478 · mangowm/mango · GitHub
[go: up one dir, main page]

Skip to content

feat: add aspect_ratio window rule for floating windows - #1478

Open
Ssnibles wants to merge 1 commit into
mangowm:mainfrom
Ssnibles:feat/keep-aspect-ratio
Open

Ssnibles wants to merge 1 commit into
mangowm:mainfrom
Ssnibles:feat/keep-aspect-ratio

Conversation

@Ssnibles
@Ssnibles Ssnibles commented Oct 2, 2026
Copy link
Copy Markdown
Contributor

Adds an aspect_ratio window rule that locks the aspect ratio of floating windows.

Accepted Formats

  • width:height (eg 16:9)
  • Plain float (eg 1.7778)
  • auto (preserves the windows initial opening ratio)

Examples

# Fixed ratio
windowrule=isfloating:1,aspect_ratio:16:9,appid:mpv

# Keep the ratio the window opens with
windowrule=isfloating:1,aspect_ratio:auto,appid:imv

# Every window (only floating windows are constrained)
windowrule=aspect_ratio:auto,appid:.*
  • Tiled windows are unaffected
  • Mouse resizing keeps the corner opposite the dragged edge fixed
  • Client min/max size hints still take priority

Add an aspect_ratio window rule that locks the aspect ratio of floating
windows. Accepts a width:height ratio such as 16:9, a plain float such as
1.7778, or auto to capture and keep the ratio the window first opens with.

Tiled windows are unaffected; a window that later becomes floating keeps
the configured or captured ratio. Interactive mouse resizing keeps the
edges opposite the grabbed corner fixed, and client size hints still win
at the extremes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0