detached 1b0bfc7

fix(core): keep rule workspaces ahead of the X11 output hint and read the keyboard grab once per sync

commit
1b0bfc7be7ac404481a59bb6f9f28abfd2205323
author
brice · · 2026-10-22 15:39 UTC
committer
brice · · 2026-10-22 17:54 UTC
parent
56a0abd
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +15 -4
M internal/adapters/wayland/inhibit.go +4 -3
@@ -121,10 +121,11 @@ func (s *Server) syncInhibitors() {
121121 idle[in.window] = true
122122 }
123123 }
124- if id := s.xgrabWindow(); id != 0 {
125- shortcuts[id] = true
126- }
124+ // syncKeyboardGrab compares against xgrabbed: it is only written here.
127125 s.xgrabbed = s.xgrabWindow()
126+ if s.xgrabbed != 0 {
127+ shortcuts[s.xgrabbed] = true
128+ }
128129 for id, on := range diffSets(s.shortcutWindows, shortcuts) {
129130 s.emit(ports.ShortcutsInhibit{Window: id, Active: on})
130131 }
@@ -121,10 +121,11 @@ func (s *Server) syncInhibitors() {
121 idle[in.window] = true121 idle[in.window] = true
122 }122 }
123 }123 }
124- if id := s.xgrabWindow(); id != 0 {124+ // syncKeyboardGrab compares against xgrabbed: it is only written here.
125- shortcuts[id] = true
126- }
127 s.xgrabbed = s.xgrabWindow()125 s.xgrabbed = s.xgrabWindow()
126+ if s.xgrabbed != 0 {
127+ shortcuts[s.xgrabbed] = true
128+ }
128 for id, on := range diffSets(s.shortcutWindows, shortcuts) {129 for id, on := range diffSets(s.shortcutWindows, shortcuts) {
129 s.emit(ports.ShortcutsInhibit{Window: id, Active: on})130 s.emit(ports.ShortcutsInhibit{Window: id, Active: on})
130 }131 }
M internal/core/rules_test.go +10 -0
@@ -432,6 +432,16 @@ func TestMapAtOutputKeepsRuleMonitor(t *testing.T) {
432432 }
433433 }
434434
435+func TestMapAtOutputKeepsRuleWorkspace(t *testing.T) {
436+ r := startMulti(t, func(c *ports.Config) {
437+ c.Rules = []ports.WindowRule{winRule("g", "game", func(r *ports.WindowRule) { r.Workspace = "1" })}
438+ }, left, right)
439+ r.client <- ports.WindowMapped{ID: 2, AppID: "game", HasAt: true, AtX: 200, AtY: 0}
440+ if w := stWindow(r.stateWith(t, 2), 2); w.Output != "DP-1" {
441+ t.Fatalf("rule workspace lost to the hint: %+v", w)
442+ }
443+}
444+
435445 func TestRuleMatchesSteamAppClass(t *testing.T) {
436446 r := startMulti(t, func(c *ports.Config) {
437447 c.Rules = []ports.WindowRule{winRule("steam", `steam_app_\d+`, func(r *ports.WindowRule) { r.Floating = ruleOn() })}
@@ -432,6 +432,16 @@ func TestMapAtOutputKeepsRuleMonitor(t *testing.T) {
432 }432 }
433 }433 }
434 434
435+func TestMapAtOutputKeepsRuleWorkspace(t *testing.T) {
436+ r := startMulti(t, func(c *ports.Config) {
437+ c.Rules = []ports.WindowRule{winRule("g", "game", func(r *ports.WindowRule) { r.Workspace = "1" })}
438+ }, left, right)
439+ r.client <- ports.WindowMapped{ID: 2, AppID: "game", HasAt: true, AtX: 200, AtY: 0}
440+ if w := stWindow(r.stateWith(t, 2), 2); w.Output != "DP-1" {
441+ t.Fatalf("rule workspace lost to the hint: %+v", w)
442+ }
443+}
444+
435 func TestRuleMatchesSteamAppClass(t *testing.T) {445 func TestRuleMatchesSteamAppClass(t *testing.T) {
436 r := startMulti(t, func(c *ports.Config) {446 r := startMulti(t, func(c *ports.Config) {
437 c.Rules = []ports.WindowRule{winRule("steam", `steam_app_\d+`, func(r *ports.WindowRule) { r.Floating = ruleOn() })}447 c.Rules = []ports.WindowRule{winRule("steam", `steam_app_\d+`, func(r *ports.WindowRule) { r.Floating = ruleOn() })}
M internal/core/spawn_placement.go +1 -1
@@ -142,7 +142,7 @@ func (p *spawnPlacement) place(c *Core, v ports.WindowMapped) {
142142 eff, ok := c.ruleFor(v)
143143 // A window mapping at an output's rect goes to that output unless a
144144 // rule names a monitor or workspace.
145- if v.HasAt && !v.Remap && eff.monitor == "" {
145+ if v.HasAt && !v.Remap && eff.monitor == "" && eff.workspace == "" && eff.number == 0 {
146146 if i := c.screenAt(float64(v.AtX), float64(v.AtY)); i >= 0 && i != c.focusScreen {
147147 eff.monitor, ok = c.screens[i].name(), true
148148 }
@@ -142,7 +142,7 @@ func (p *spawnPlacement) place(c *Core, v ports.WindowMapped) {
142 eff, ok := c.ruleFor(v)142 eff, ok := c.ruleFor(v)
143 // A window mapping at an output's rect goes to that output unless a143 // A window mapping at an output's rect goes to that output unless a
144 // rule names a monitor or workspace.144 // rule names a monitor or workspace.
145- if v.HasAt && !v.Remap && eff.monitor == "" {145+ if v.HasAt && !v.Remap && eff.monitor == "" && eff.workspace == "" && eff.number == 0 {
146 if i := c.screenAt(float64(v.AtX), float64(v.AtY)); i >= 0 && i != c.focusScreen {146 if i := c.screenAt(float64(v.AtX), float64(v.AtY)); i >= 0 && i != c.focusScreen {
147 eff.monitor, ok = c.screens[i].name(), true147 eff.monitor, ok = c.screens[i].name(), true
148 }148 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 26

Tags 10

↑↓ moveenter openesc close