Skip to content

fix(shell): synchronize surface card border width with hyprland active border width - #11403

Open
cleon01day wants to merge 1 commit into
omacom:quattrofrom
cleon01day:fix/sync-shell-border-width
Open

cleon01day wants to merge 1 commit into
omacom:quattrofrom
cleon01day:fix/sync-shell-border-width

Conversation

@cleon01day

Copy link
Copy Markdown

Summary

Synchronize Quickshell surface card border widths with Hyprland active border width tokens, resolving an issue where customizing general.border_size in Hyprland leaves shell surfaces stuck at 2px.


Context & Problem

In Omarchy, users can customize general.border_size in ~/.config/hypr/looknfeel.lua (e.g., setting border_size = 1 for a crisp hairline border on high-DPI/Retina screens).

However, Quickshell layer surfaces (omarchy.menu, Osd, NotificationCard, Clipboard, Emojis, ReminderFlow, PolkitAgent) do not track or inherit the active Hyprland border width. Currently, each component passes Math.max(1, Style.space(2)) directly to Border.surfaceSpec, which evaluates to a hardcoded 2px fallback.

Although [hyprland] in shell.toml.tpl was explicitly designed to keep surface cards aligned with Hyprland (# Surface sections reference these so lock, notifications, popups, and menu-style cards stay aligned with the current Hyprland active-border gradient), and Border.qml already contains an uncalled helper hyprlandActiveSpec that references value("hyprland", "active-border-width"), this width was never exposed in the template or checked in surfaceWidths.

In stock Omarchy, this discrepancy was masked because both Hyprland and Quickshell happened to use 2 by default. As soon as a user customizes border_size, the shell surfaces fall out of visual alignment with application windows.


Solution

  1. Expose active-border-width in default/themed/shell.toml.tpl:
    Added active-border-width = 2 under [hyprland] alongside existing border gradient tokens.
  2. Fallback to hyprland.active-border-width in shell/Commons/Border.qml:
    In surfaceWidths, if the section does not define an explicit border-width, check value("hyprland", "active-border-width") before falling back to the component's fallbackWidth.
  3. Full Backward Compatibility:
    • Explicit section overrides (e.g. [menu] border-width = 1 in shell.toml) continue to take top precedence.
    • If active-border-width is omitted (legacy themes), it gracefully falls back to fallbackWidth (Style.space(2)).
    • Interactive control chrome ([controls] / buttons / tabs) remains completely untouched as it uses controlSpec.
  4. Automated Unit Test:
    Added test/shell.d/surface-border-sync-test.sh verifying fallback resolution priority across all three tiers.

Verification

  • Ran ./test/cli: all 105 tests passed.
  • Ran test/shell.d/surface-border-sync-test.sh: all 5 assertions passed.
  • Ran test/shell.d/border-geometry-test.sh, button-border-stability-test.sh, and row-border-stability-test.sh: all passed.
  • Verified live in Hyprland 0.56.2 + Quickshell on Arch Linux.

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