test(core): check separators skip a tile under a bottom panel
Capture configures use a whole viewport like the capture scene.
- commit
- b264e57b327a41fe29e9aa1b4413c9ecf13602f6
- author
- brice · · 2026-10-08 13:33 UTC
- parent
- f7c2be9
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +7 -2
M internal/core/capture_workspace.go +1 -1
| @@ -91,7 +91,7 @@ func (c *Core) captureConfigure(sc *screen, p Placement, t configureTarget) (*Pl | |||
| 91 | 91 | // An overview preview keeps its real size and physical state. | |
| 92 | 92 | return cp, t | |
| 93 | 93 | } | |
| 94 | - | t.view = viewport{frame: cw.frame, usable: cw.ws.Usable} | |
| 94 | + | t.view = whole(cw.frame) // the capture image has no panels | |
| 95 | 95 | t.focused = false | |
| 96 | 96 | t.client, t.imposed = Rect{}, false | |
| 97 | 97 | if !cp.Hidden { | |
| @@ -91,7 +91,7 @@ func (c *Core) captureConfigure(sc *screen, p Placement, t configureTarget) (*Pl | |||||
| 91 | // An overview preview keeps its real size and physical state. | 91 | // An overview preview keeps its real size and physical state. | ||
| 92 | return cp, t | 92 | return cp, t | ||
| 93 | } | 93 | } | ||
| 94 | - | t.view = viewport{frame: cw.frame, usable: cw.ws.Usable} | 94 | + | t.view = whole(cw.frame) // the capture image has no panels |
| 95 | t.focused = false | 95 | t.focused = false | ||
| 96 | t.client, t.imposed = Rect{}, false | 96 | t.client, t.imposed = Rect{}, false | ||
| 97 | if !cp.Hidden { | 97 | if !cp.Hidden { | ||
M internal/core/separators_test.go +6 -1
| @@ -183,10 +183,15 @@ func TestSeparatorsCascadeBottomPanel(t *testing.T) { | |||
| 183 | 183 | if p := previewOf(t, ps, 1); p.Neighbors != ports.SideRight { | |
| 184 | 184 | t.Fatalf("neighbors %04b, want right only", p.Neighbors) | |
| 185 | 185 | } | |
| 186 | - | seps := separators(ps, 2, 0, whole(w.Output), true) | |
| 186 | + | seps := separators(ps, 2, 0, viewport{frame: w.Output, usable: w.Usable}, true) | |
| 187 | 187 | if got := colorAt(seps, 200, 578); got != "" { | |
| 188 | 188 | t.Fatalf("line along the panel: %v", seps) | |
| 189 | 189 | } | |
| 190 | + | for _, s := range seps { | |
| 191 | + | if s.Window == 3 { | |
| 192 | + | t.Fatalf("line of the tile under the panel: %v", seps) | |
| 193 | + | } | |
| 194 | + | } | |
| 190 | 195 | // Two tiles on screen: each lights its half of the shared line. | |
| 191 | 196 | if got := colorAt(seps, 449, 100); got != "lit" { | |
| 192 | 197 | t.Fatalf("shared line (449,100) = %q; %v", got, seps) | |
| @@ -183,10 +183,15 @@ func TestSeparatorsCascadeBottomPanel(t *testing.T) { | |||||
| 183 | if p := previewOf(t, ps, 1); p.Neighbors != ports.SideRight { | 183 | if p := previewOf(t, ps, 1); p.Neighbors != ports.SideRight { | ||
| 184 | t.Fatalf("neighbors %04b, want right only", p.Neighbors) | 184 | t.Fatalf("neighbors %04b, want right only", p.Neighbors) | ||
| 185 | } | 185 | } | ||
| 186 | - | seps := separators(ps, 2, 0, whole(w.Output), true) | 186 | + | seps := separators(ps, 2, 0, viewport{frame: w.Output, usable: w.Usable}, true) |
| 187 | if got := colorAt(seps, 200, 578); got != "" { | 187 | if got := colorAt(seps, 200, 578); got != "" { | ||
| 188 | t.Fatalf("line along the panel: %v", seps) | 188 | t.Fatalf("line along the panel: %v", seps) | ||
| 189 | } | 189 | } | ||
| 190 | + | for _, s := range seps { | |||
| 191 | + | if s.Window == 3 { | |||
| 192 | + | t.Fatalf("line of the tile under the panel: %v", seps) | |||
| 193 | + | } | |||
| 194 | + | } | |||
| 190 | // Two tiles on screen: each lights its half of the shared line. | 195 | // Two tiles on screen: each lights its half of the shared line. | ||
| 191 | if got := colorAt(seps, 449, 100); got != "lit" { | 196 | if got := colorAt(seps, 449, 100); got != "lit" { | ||
| 192 | t.Fatalf("shared line (449,100) = %q; %v", got, seps) | 197 | t.Fatalf("shared line (449,100) = %q; %v", got, seps) | ||