Skip to content

Ignore missing group window indexes - #10693

Closed
aastrand wants to merge 1 commit into
omacom:quattrofrom
aastrand:fix/group-window-index-guard
Closed

aastrand wants to merge 1 commit into
omacom:quattrofrom
aastrand:fix/group-window-index-guard

Conversation

@aastrand

@aastrand aastrand commented Sep 7, 2026 •

Copy link
Copy Markdown

What changed

Guard the numbered group-window bindings before dispatching to hl.dsp.group.active.

Pressing Super+Alt+1–5 now:

  • switches normally when that member exists in the active window group
  • quietly does nothing when the active window is ungrouped or the requested index is outside the group

This prevents Hyprland from showing a Lua runtime-error notification for a missing group member.

Screenshot pre-fix

image

Testing

  • Tested live on Hyprland 0.56.2:
    • valid indexes still switch grouped windows
    • nonexistent indexes on grouped and ungrouped windows are quiet no-ops
  • luac -p default/hypr/bindings/tiling.lua
  • bash test/shell.d/hyprland-default-config-test.sh
  • bash test/shell.d/hyprland-binding-conflicts-test.sh

@paulogeyer paulogeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 — right fix for #12085.

Live-verified on Omarchy / Hyprland 0.56.2: stock SUPER+ALT+3 (group of 2) shows Runtime error in lua: Index out of range; with a size-guard before hl.dsp.group.active the miss is a silent no-op and SUPER+ALT+1/2 still switch.

Please also pull in the small regression test from #8411 (test/shell.d/hyprland-group-bindings-test.sh) so this doesn’t regress. Prefer this focused PR over the pcall-only hunk in #12155.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @aastrand. It is the same change as #8411, which was opened earlier against quattro, so I'm closing this one in favour of it.

Both PRs fix #12085 the same way: in default/hypr/bindings/tiling.lua the Super+Alt+1–5 bindings become functions that look up hl.get_active_window(), read its group, and call hl.dispatch(hl.dsp.group.active({ index = index })) only when the window is grouped and index <= group.size. The cause, the guard and the result are identical. #8411 also adds a regression test, test/shell.d/hyprland-group-bindings-test.sh, that covers an in-range index, an out-of-range index and an ungrouped window, so it is the more complete of the two.

I compared the two diffs by reading them. Nothing was run for this check. Codex Medium was asked separately whether they make the same change and agreed. Independence isn't guaranteed, since it can read this session's reasoning.

If I've got this wrong and there is a difference that matters, say so and it can be reopened.

@omarchybot omarchybot added the duplicate This issue or pull request already exists label Oct 2, 2026
@omarchybot omarchybot closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants