Skip to content

feat(group): add click-to-pin drawer option - #5526

Open
brcha wants to merge 1 commit into
Alexays:masterfrom
brcha:feat/group-click-to-pin
Open

brcha wants to merge 1 commit into
Alexays:masterfrom
brcha:feat/group-click-to-pin

Conversation

@brcha

@brcha brcha commented Nov 25, 2026

Copy link
Copy Markdown

What does this PR do?

A drawer opens either on hover or, with click-to-reveal, on click; it cannot do both. This adds a click-to-pin drawer option that keeps hover and adds a click on top:

  • The drawer opens on hover and closes on leave, as before.
  • A left click keeps it open after the pointer leaves, until the next left click.
  • While pinned, the group box carries the pinned CSS class, so a pinned drawer can be styled apart from one that will close on leave.
  • Unpinning leaves the drawer open while the pointer is still over it; it closes on the next leave.
  • As with click-to-reveal, modules with their own on-click keep it; only clicks they do not handle reach the group and pin it.
  • With click-to-reveal set, the option has no effect. Groups that do not set it behave as before.

This is useful for drawers that you want to keep open while the pointer is elsewhere, for example while a tray item's menu is open, or to keep values in view.

"group/system": {
    "orientation": "inherit",
    "drawer": { "click-to-pin": true },
    "modules": ["custom/system", "cpu", "memory", "temperature"]
}
#system.pinned { border-bottom: 2px solid #f67e7d; }

The man page documents the option next to click-to-reveal and the class next to .expanded. The smoke interaction tier gets a section that checks hover open/close, pin, and unpin through the virtual pointer; the config fuzzer picks the option up from the man page.

This touches the same handlers as #5482 (touch) and the GTK4 port in #5454; I am happy to rebase onto whichever lands first.

Related issues

Related to #3256, which asked for a toggleable drawer and was closed by click-to-reveal (which drops hover). #4043 adds a signal to toggle a group, which is complementary.

Checklist

  • Code is formatted with clang-format
  • Builds locally (ninja -C build)
  • Man page updated for any new/changed user-facing option (man/)
  • Tested against the affected module(s)

A drawer opens either on hover or, with click-to-reveal, on click,
never both. The new click-to-pin drawer option keeps hover and lets a
left click keep the drawer open after the pointer leaves, until the next
left click. The group box carries the pinned CSS class while pinned.

Clicks that a grouped module handles itself do not pin the drawer. The
option has no effect together with click-to-reveal.

Document the option and the class in waybar(5), and cover hover, pin and
unpin in the smoke interaction tier.
brcha added a commit to brcha/nixos_configuration that referenced this pull request Nov 25, 2026
…117)

Name the upstream pull request for the local Waybar click-to-pin patch in home/apps/AGENTS.md, and say when the patch goes.

Commits:

* docs: note the upstream Waybar pull request for the drawer pin patch

  The click-to-pin patch is proposed upstream as Alexays/Waybar#5526 with
  the same option name and CSS class. Say in home/apps/AGENTS.md that the
  patch and its overrideAttrs go once a Waybar release containing it
  reaches nixpkgs-unstable.

  Closes #116

Closes #116
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