Skip to content

groups: add groupbar disable_when_only option#15009

Open
feelamee wants to merge 4 commits into
hyprwm:mainfrom
feelamee:hide-groupbar-with-one-window
Open

groups: add groupbar disable_when_only option#15009
feelamee wants to merge 4 commits into
hyprwm:mainfrom
feelamee:hide-groupbar-with-one-window

Conversation

@feelamee

@feelamee feelamee commented Jun 7, 2026

Copy link
Copy Markdown

group:groupbar:disable_when_only

Option allow to hide groupbar if it contains only single window.
This is especially useful with rule:

-- any window will be opened in group
hl.window_rule({ match = { title = ".*" }, group = "set" })

Possible issues

  • option was added looking at group:groupbar:enable, but in refreshGroupBarGradients there is no availible active group to properly check option disable_when_only
    I think this check unnecessary here because same scenario already exist when there is no windows with groupbar, but option enabled == true. But unsure - require review.
  • new hyprtest is unstable for some reason. Sometimes fail, and sometimes succeed. Maybe this is related to error "(EE) failed to read Wayland events: Broken pipe" which printed in stdout when I launched hyprtest. Anyway, I tested it in practice - launching Hyprland with this patch as single window manager - and feature works well.

Is it ready for merging, or does it need work?

First of all it is need an approve - do we need such feature at all. Then - I tried my best to do this PR as possible as ready for merge. But I'm open for critique and suggestions.


wiki PR - hyprwm/hyprland-wiki#1551

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

If your code can be tested, please always add tests. See more here.

beep boop, I'm just a bot. A real human will review your PR soon.

Comment thread src/config/values/ConfigValues.cpp Outdated
@feelamee feelamee force-pushed the hide-groupbar-with-one-window branch from 154710f to 0751abd Compare June 8, 2026 21:39
feelamee added a commit to feelamee/hyprland-wiki that referenced this pull request Jun 8, 2026
@feelamee feelamee changed the title groups: add groupbar disable_if_contains_single_window option groups: add groupbar disable_when_only option Jun 8, 2026
vaxerski
vaxerski previously approved these changes Jun 11, 2026

@vaxerski vaxerski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tnx

@vaxerski

Copy link
Copy Markdown
Member

your test fails :(

@feelamee

feelamee commented Jun 24, 2026

Copy link
Copy Markdown
Author

@vaxerski
look, now I broke groups test too :D
Detailed explanation in commit message, pasting it here to:

groups_disable_when_only test fails because it checks windows sizes after
disable_when_only option changed. Changing option currently don't
trigger window size update.

Same problem with groups test, but it worked because it or:

  • didn't checked window size after changing option.
  • called hl.dsp.group.toggle(), which trigger size update
  • at the begining set enable = 1 while it == 1 by default
    Now it fails too :D

Seems it works in usual Hyprland usage because:

  • CHyprGroupBarDecoration::draw calls
  • g_pDecorationPositioner->repositionDeco(this),
    which will invalidate cache and update sizes.

So, at first sight we just need to add REFRESH_WINDOW_STATE | REFRESH_LAYOUTS to disable_when_only config option. But it didn't work because in CDecorationPositioner::onWindowUpdate we will go in fast path and return without updating WINDOWDATA->reserved, which will be used in CWindowTarget::updatePos to finally update window size.
Therefore we need to uncacheWindowDecos first. I made ugly fix to prove this here, and this works. But we need something better.

My question:

  • maybe we need uncacheWindowDecos when REFRESH_WINDOW_STATE triggered? If no, where we can insert it?
  • then we need remove
    if (VISIBLE != m_bLastVisibilityStatus)
        g_pDecorationPositioner->repositionDeco(this);

from CHyprGroupBarDecoration::draw?

  • and also add REFRESH_WINDOW_STATE | REFRESH_LAYOUTS to group:groupbar:enabled config option?

@vaxerski

vaxerski commented Jun 28, 2026

Copy link
Copy Markdown
Member

you can call hyprctl reload probably then sync. Should work.

doh, you mean live. Yes, uncaching when window state changes is ok.

@feelamee feelamee force-pushed the hide-groupbar-with-one-window branch 2 times, most recently from d0ea2a0 to 2210e1c Compare June 28, 2026 23:50
@feelamee feelamee requested a review from vaxerski June 28, 2026 23:51
Comment thread src/render/decorations/CHyprGroupBarDecoration.cpp Outdated
@vaxerski

Copy link
Copy Markdown
Member

clang-format please

feelamee added 4 commits June 30, 2026 23:52
`groups_disable_when_only` test fails because it checks windows sizes after
`disable_when_only` option changed. Changing option currently don't
trigger window size update.

Same problem with `groups` test, but it worked because it or:
- didn't checked window size after changing option.
- called `hl.dsp.group.toggle()`, which trigger size update
- at the begining set `enable = 1` while it `== 1` by default
Now it fails too :D

Seems it works in usual Hyprland usage because:
- `CHyprGroupBarDecoration::draw` calls
- `g_pDecorationPositioner->repositionDeco(this)`,
  which will invalidate cache and update sizes.
REFRESH_LAYOUTS is not required 'cause REFRESH_WINDOW_STATES will
trigger update of window position too.
@feelamee feelamee force-pushed the hide-groupbar-with-one-window branch from 2210e1c to b8884db Compare June 30, 2026 20:54
@feelamee

feelamee commented Jul 4, 2026

Copy link
Copy Markdown
Author

@vaxerski, I fixed formatting. Any other suggestions? Or we can merge.
P.S. sorry for mentioning, is it ok to remind about PR here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants