- golang.org/x/sys v0.49.0 → v0.50.0
- golang.org/x/sync v0.24.0 → v0.25.0 (tools)
- golang.org/x/sys v0.49.0 → v0.50.0 (tools)
#136 build(deps): update 3 dependencies
M go.mod +1 -1
| @@ -16,7 +16,7 @@ require ( | |||
| 16 | 16 | github.com/rs/zerolog v1.35.1 | |
| 17 | 17 | github.com/stretchr/testify v1.12.1 | |
| 18 | 18 | golang.org/x/image v0.47.0 | |
| 19 | - | golang.org/x/sys v0.49.0 | |
| 19 | + | golang.org/x/sys v0.50.0 | |
| 20 | 20 | golang.org/x/term v0.47.0 | |
| 21 | 21 | ) | |
| 22 | 22 | ||
| @@ -16,7 +16,7 @@ require ( | |||||
| 16 | github.com/rs/zerolog v1.35.1 | 16 | github.com/rs/zerolog v1.35.1 | ||
| 17 | github.com/stretchr/testify v1.12.1 | 17 | github.com/stretchr/testify v1.12.1 | ||
| 18 | golang.org/x/image v0.47.0 | 18 | golang.org/x/image v0.47.0 | ||
| 19 | - | golang.org/x/sys v0.49.0 | 19 | + | golang.org/x/sys v0.50.0 |
| 20 | golang.org/x/term v0.47.0 | 20 | golang.org/x/term v0.47.0 | ||
| 21 | ) | 21 | ) | ||
| 22 | 22 | ||||
M go.sum +2 -2 generated file: collapsed
M internal/core/spawn_placement.go +2 -4
| @@ -199,10 +199,8 @@ func sameApp(a, b ports.WindowMapped) bool { | |||
| 199 | 199 | // Callers pass only visible, non-quiet, non-floating arrivals (a rule | |
| 200 | 200 | // floating it included); same-app windows keep their ordinary column. | |
| 201 | 201 | func (c *Core) placeLaunched(v ports.WindowMapped, sc *screen, w *Workspace, cells int) bool { | |
| 202 | - | // A shown capturing stash takes the window instead (addWindow), unless | |
| 203 | - | // a fullscreen window covers the output: a window launched by its group | |
| 204 | - | // stays with it, under the stash shown over it. | |
| 205 | - | if v.Floating || v.Parent != 0 || v.Remap || sc.mon.captures(w) && w.Cover() == 0 { | |
| 202 | + | // A shown capturing stash takes the window instead (addWindow). | |
| 203 | + | if v.Floating || v.Parent != 0 || v.Remap || sc.mon.captures(w) { | |
| 206 | 204 | return false | |
| 207 | 205 | } | |
| 208 | 206 | l := c.launcherOf(v.ID) | |
| @@ -199,10 +199,8 @@ func sameApp(a, b ports.WindowMapped) bool { | |||||
| 199 | // Callers pass only visible, non-quiet, non-floating arrivals (a rule | 199 | // Callers pass only visible, non-quiet, non-floating arrivals (a rule | ||
| 200 | // floating it included); same-app windows keep their ordinary column. | 200 | // floating it included); same-app windows keep their ordinary column. | ||
| 201 | func (c *Core) placeLaunched(v ports.WindowMapped, sc *screen, w *Workspace, cells int) bool { | 201 | func (c *Core) placeLaunched(v ports.WindowMapped, sc *screen, w *Workspace, cells int) bool { | ||
| 202 | - | // A shown capturing stash takes the window instead (addWindow), unless | 202 | + | // A shown capturing stash takes the window instead (addWindow). |
| 203 | - | // a fullscreen window covers the output: a window launched by its group | 203 | + | if v.Floating || v.Parent != 0 || v.Remap || sc.mon.captures(w) { |
| 204 | - | // stays with it, under the stash shown over it. | |||
| 205 | - | if v.Floating || v.Parent != 0 || v.Remap || sc.mon.captures(w) && w.Cover() == 0 { | |||
| 206 | return false | 204 | return false | ||
| 207 | } | 205 | } | ||
| 208 | l := c.launcherOf(v.ID) | 206 | l := c.launcherOf(v.ID) | ||
M internal/core/stash_cover_test.go +6 -64
| @@ -97,9 +97,9 @@ func TestStashShowsOverCover(t *testing.T) { | |||
| 97 | 97 | } | |
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | - | // A window mapping while the stash shows over the cover is captured, | |
| 101 | - | // shown above the cover; a dialog of the cover shows above the stash, and | |
| 102 | - | // the override ends with its cover. | |
| 100 | + | // Only the user shows the stash over the cover: a window mapping | |
| 101 | + | // meanwhile is not captured, a dialog of the cover shows above the | |
| 102 | + | // stash, and the override ends with its cover. | |
| 103 | 103 | func TestStashOverCoverEdges(t *testing.T) { | |
| 104 | 104 | synctest.Test(t, func(t *testing.T) { | |
| 105 | 105 | c, w, cover := stashCoverCore(t, OverflowFixed, false) | |
| @@ -107,8 +107,8 @@ func TestStashOverCoverEdges(t *testing.T) { | |||
| 107 | 107 | m.SetStashCapture(true) | |
| 108 | 108 | c.applyAction(ActionToggleStashVisible) | |
| 109 | 109 | m.AddWindow(5) | |
| 110 | - | if id, _ := w.Focused(); w.StashIndex(5) < 0 || id != 5 || previewOf(t, w.Layout(), 5).Hidden || !modelStashOverCover(w) { | |
| 111 | - | t.Fatalf("new window not captured over the cover: %+v", w.Layout()) | |
| 110 | + | if w.StashIndex(5) >= 0 || !previewOf(t, w.Layout(), 5).Hidden { | |
| 111 | + | t.Fatalf("new window shown: %+v", w.Layout()) | |
| 112 | 112 | } | |
| 113 | 113 | w.AddDialog(6, cover, 20, 20) | |
| 114 | 114 | if ps := w.Layout(); ps[len(ps)-1].ID != 6 { | |
| @@ -118,7 +118,7 @@ func TestStashOverCoverEdges(t *testing.T) { | |||
| 118 | 118 | t.Fatalf("dialog focus %d", id) | |
| 119 | 119 | } | |
| 120 | 120 | c.applyAction(ActionFocusColumnLeft) // back to the stash | |
| 121 | - | if id, _ := w.Focused(); id != 5 || !modelStashOverCover(w) { | |
| 121 | + | if id, _ := w.Focused(); id != 3 || !modelStashOverCover(w) { | |
| 122 | 122 | t.Fatalf("from dialog: focused %d", id) | |
| 123 | 123 | } | |
| 124 | 124 | w.RemoveWindow(6) | |
| @@ -446,61 +446,3 @@ func TestCoreActivateStashKeepsGameConfigure(t *testing.T) { | |||
| 446 | 446 | func isID(id WindowID) func(Placement) bool { | |
| 447 | 447 | return func(p Placement) bool { return p.ID == id } | |
| 448 | 448 | } | |
| 449 | - | ||
| 450 | - | // With stash.capture, a window mapping while the stash shows over a | |
| 451 | - | // fullscreen cover joins the stash, focused above the cover; a window of | |
| 452 | - | // the cover's app stays with the cover instead. | |
| 453 | - | func TestStashOverCoverMapCapture(t *testing.T) { | |
| 454 | - | for _, tc := range []struct { | |
| 455 | - | name string | |
| 456 | - | next ports.WindowMapped | |
| 457 | - | captured bool | |
| 458 | - | }{ | |
| 459 | - | {"unrelated", ports.WindowMapped{ID: 4, PID: 9, AppID: "other"}, true}, | |
| 460 | - | {"cover app", ports.WindowMapped{ID: 4, PID: 7, AppID: "game"}, false}, | |
| 461 | - | } { | |
| 462 | - | t.Run(tc.name, func(t *testing.T) { | |
| 463 | - | synctest.Test(t, func(t *testing.T) { | |
| 464 | - | c, _, _ := fadeCore(t) | |
| 465 | - | ctx := context.Background() | |
| 466 | - | m := c.cur().mon | |
| 467 | - | m.SetStashCapture(true) | |
| 468 | - | w := m.Current() | |
| 469 | - | c.clientEvent(ctx, ports.WindowMapped{ID: 2, PID: 8, AppID: "stashed"}) | |
| 470 | - | w.ToggleWindowStash() | |
| 471 | - | w.ToggleStashVisible() | |
| 472 | - | c.clientEvent(ctx, ports.WindowMapped{ID: 1, PID: 7, AppID: "game"}) | |
| 473 | - | c.clientEvent(ctx, ports.WindowFullscreenRequest{ID: 1, Fullscreen: true}) | |
| 474 | - | c.applyAction(ActionToggleStashVisible) | |
| 475 | - | if !modelStashOverCover(w) { | |
| 476 | - | t.Fatal("stash not shown over the cover") | |
| 477 | - | } | |
| 478 | - | c.clientEvent(ctx, tc.next) | |
| 479 | - | if w.Fullscreen != 1 { | |
| 480 | - | t.Fatalf("fullscreen lost: %d", w.Fullscreen) | |
| 481 | - | } | |
| 482 | - | if id, _ := w.Focused(); id != 4 { | |
| 483 | - | t.Fatalf("arrival not focused: %d", id) | |
| 484 | - | } | |
| 485 | - | if tc.captured && w.Cover() != 1 { | |
| 486 | - | t.Fatalf("cover lost: fullscreen %d cover %d", w.Fullscreen, w.Cover()) | |
| 487 | - | } | |
| 488 | - | if got := w.StashIndex(4) >= 0; got != tc.captured { | |
| 489 | - | t.Fatalf("captured %v, stash %+v path %s", got, w.Stash, c.placementPath) | |
| 490 | - | } | |
| 491 | - | if !tc.captured { | |
| 492 | - | return | |
| 493 | - | } | |
| 494 | - | if w.StashAt() != w.StashIndex(4) || !modelStashOverCover(w) { | |
| 495 | - | t.Fatalf("stashAt %d", w.StashAt()) | |
| 496 | - | } | |
| 497 | - | if p := previewOf(t, w.Layout(), 4); p.Hidden { | |
| 498 | - | t.Fatalf("captured window hidden: %+v", p) | |
| 499 | - | } | |
| 500 | - | if p := previewOf(t, w.Layout(), 1); p.Hidden || !p.Fullscreen { | |
| 501 | - | t.Fatalf("cover %+v", p) | |
| 502 | - | } | |
| 503 | - | }) | |
| 504 | - | }) | |
| 505 | - | } | |
| 506 | - | } | |
| @@ -97,9 +97,9 @@ func TestStashShowsOverCover(t *testing.T) { | |||||
| 97 | } | 97 | } | ||
| 98 | } | 98 | } | ||
| 99 | 99 | ||||
| 100 | - | // A window mapping while the stash shows over the cover is captured, | 100 | + | // Only the user shows the stash over the cover: a window mapping |
| 101 | - | // shown above the cover; a dialog of the cover shows above the stash, and | 101 | + | // meanwhile is not captured, a dialog of the cover shows above the |
| 102 | - | // the override ends with its cover. | 102 | + | // stash, and the override ends with its cover. |
| 103 | func TestStashOverCoverEdges(t *testing.T) { | 103 | func TestStashOverCoverEdges(t *testing.T) { | ||
| 104 | synctest.Test(t, func(t *testing.T) { | 104 | synctest.Test(t, func(t *testing.T) { | ||
| 105 | c, w, cover := stashCoverCore(t, OverflowFixed, false) | 105 | c, w, cover := stashCoverCore(t, OverflowFixed, false) | ||
| @@ -107,8 +107,8 @@ func TestStashOverCoverEdges(t *testing.T) { | |||||
| 107 | m.SetStashCapture(true) | 107 | m.SetStashCapture(true) | ||
| 108 | c.applyAction(ActionToggleStashVisible) | 108 | c.applyAction(ActionToggleStashVisible) | ||
| 109 | m.AddWindow(5) | 109 | m.AddWindow(5) | ||
| 110 | - | if id, _ := w.Focused(); w.StashIndex(5) < 0 || id != 5 || previewOf(t, w.Layout(), 5).Hidden || !modelStashOverCover(w) { | 110 | + | if w.StashIndex(5) >= 0 || !previewOf(t, w.Layout(), 5).Hidden { |
| 111 | - | t.Fatalf("new window not captured over the cover: %+v", w.Layout()) | 111 | + | t.Fatalf("new window shown: %+v", w.Layout()) |
| 112 | } | 112 | } | ||
| 113 | w.AddDialog(6, cover, 20, 20) | 113 | w.AddDialog(6, cover, 20, 20) | ||
| 114 | if ps := w.Layout(); ps[len(ps)-1].ID != 6 { | 114 | if ps := w.Layout(); ps[len(ps)-1].ID != 6 { | ||
| @@ -118,7 +118,7 @@ func TestStashOverCoverEdges(t *testing.T) { | |||||
| 118 | t.Fatalf("dialog focus %d", id) | 118 | t.Fatalf("dialog focus %d", id) | ||
| 119 | } | 119 | } | ||
| 120 | c.applyAction(ActionFocusColumnLeft) // back to the stash | 120 | c.applyAction(ActionFocusColumnLeft) // back to the stash | ||
| 121 | - | if id, _ := w.Focused(); id != 5 || !modelStashOverCover(w) { | 121 | + | if id, _ := w.Focused(); id != 3 || !modelStashOverCover(w) { |
| 122 | t.Fatalf("from dialog: focused %d", id) | 122 | t.Fatalf("from dialog: focused %d", id) | ||
| 123 | } | 123 | } | ||
| 124 | w.RemoveWindow(6) | 124 | w.RemoveWindow(6) | ||
| @@ -446,61 +446,3 @@ func TestCoreActivateStashKeepsGameConfigure(t *testing.T) { | |||||
| 446 | func isID(id WindowID) func(Placement) bool { | 446 | func isID(id WindowID) func(Placement) bool { | ||
| 447 | return func(p Placement) bool { return p.ID == id } | 447 | return func(p Placement) bool { return p.ID == id } | ||
| 448 | } | 448 | } | ||
| 449 | - | ||||
| 450 | - | // With stash.capture, a window mapping while the stash shows over a | |||
| 451 | - | // fullscreen cover joins the stash, focused above the cover; a window of | |||
| 452 | - | // the cover's app stays with the cover instead. | |||
| 453 | - | func TestStashOverCoverMapCapture(t *testing.T) { | |||
| 454 | - | for _, tc := range []struct { | |||
| 455 | - | name string | |||
| 456 | - | next ports.WindowMapped | |||
| 457 | - | captured bool | |||
| 458 | - | }{ | |||
| 459 | - | {"unrelated", ports.WindowMapped{ID: 4, PID: 9, AppID: "other"}, true}, | |||
| 460 | - | {"cover app", ports.WindowMapped{ID: 4, PID: 7, AppID: "game"}, false}, | |||
| 461 | - | } { | |||
| 462 | - | t.Run(tc.name, func(t *testing.T) { | |||
| 463 | - | synctest.Test(t, func(t *testing.T) { | |||
| 464 | - | c, _, _ := fadeCore(t) | |||
| 465 | - | ctx := context.Background() | |||
| 466 | - | m := c.cur().mon | |||
| 467 | - | m.SetStashCapture(true) | |||
| 468 | - | w := m.Current() | |||
| 469 | - | c.clientEvent(ctx, ports.WindowMapped{ID: 2, PID: 8, AppID: "stashed"}) | |||
| 470 | - | w.ToggleWindowStash() | |||
| 471 | - | w.ToggleStashVisible() | |||
| 472 | - | c.clientEvent(ctx, ports.WindowMapped{ID: 1, PID: 7, AppID: "game"}) | |||
| 473 | - | c.clientEvent(ctx, ports.WindowFullscreenRequest{ID: 1, Fullscreen: true}) | |||
| 474 | - | c.applyAction(ActionToggleStashVisible) | |||
| 475 | - | if !modelStashOverCover(w) { | |||
| 476 | - | t.Fatal("stash not shown over the cover") | |||
| 477 | - | } | |||
| 478 | - | c.clientEvent(ctx, tc.next) | |||
| 479 | - | if w.Fullscreen != 1 { | |||
| 480 | - | t.Fatalf("fullscreen lost: %d", w.Fullscreen) | |||
| 481 | - | } | |||
| 482 | - | if id, _ := w.Focused(); id != 4 { | |||
| 483 | - | t.Fatalf("arrival not focused: %d", id) | |||
| 484 | - | } | |||
| 485 | - | if tc.captured && w.Cover() != 1 { | |||
| 486 | - | t.Fatalf("cover lost: fullscreen %d cover %d", w.Fullscreen, w.Cover()) | |||
| 487 | - | } | |||
| 488 | - | if got := w.StashIndex(4) >= 0; got != tc.captured { | |||
| 489 | - | t.Fatalf("captured %v, stash %+v path %s", got, w.Stash, c.placementPath) | |||
| 490 | - | } | |||
| 491 | - | if !tc.captured { | |||
| 492 | - | return | |||
| 493 | - | } | |||
| 494 | - | if w.StashAt() != w.StashIndex(4) || !modelStashOverCover(w) { | |||
| 495 | - | t.Fatalf("stashAt %d", w.StashAt()) | |||
| 496 | - | } | |||
| 497 | - | if p := previewOf(t, w.Layout(), 4); p.Hidden { | |||
| 498 | - | t.Fatalf("captured window hidden: %+v", p) | |||
| 499 | - | } | |||
| 500 | - | if p := previewOf(t, w.Layout(), 1); p.Hidden || !p.Fullscreen { | |||
| 501 | - | t.Fatalf("cover %+v", p) | |||
| 502 | - | } | |||
| 503 | - | }) | |||
| 504 | - | }) | |||
| 505 | - | } | |||
| 506 | - | } | |||
M internal/core/stash_test.go +0 -17
| @@ -196,12 +196,6 @@ func TestStashCapture(t *testing.T) { | |||
| 196 | 196 | {"dialog keeps focus", OverflowScroll, func(m *Monitor) { m.AddFloating(9, 10, 10) }, true, 9}, | |
| 197 | 197 | {"hidden", OverflowScroll, func(m *Monitor) { m.Current().ToggleStashVisible() }, false, 4}, | |
| 198 | 198 | {"under fullscreen", OverflowScroll, func(m *Monitor) { m.Current().SetFullscreen(3, true) }, false, 3}, | |
| 199 | - | {"shown over fullscreen", OverflowScroll, func(m *Monitor) { | |
| 200 | - | w := m.Current() | |
| 201 | - | w.FocusID(1) | |
| 202 | - | w.SetFullscreen(1, true) | |
| 203 | - | w.ToggleStashVisible() | |
| 204 | - | }, true, 4}, | |
| 205 | 199 | {"off", OverflowScroll, func(m *Monitor) { m.SetStashCapture(false) }, false, 3}, | |
| 206 | 200 | } { | |
| 207 | 201 | t.Run(tc.name, func(t *testing.T) { | |
| @@ -217,17 +211,6 @@ func TestStashCapture(t *testing.T) { | |||
| 217 | 211 | if id, _ := w.Focused(); id != tc.focused { | |
| 218 | 212 | t.Fatalf("focused %d", id) | |
| 219 | 213 | } | |
| 220 | - | if tc.name == "shown over fullscreen" { | |
| 221 | - | if w.Cover() != 1 || !w.StashShown() { | |
| 222 | - | t.Fatalf("cover %d shown %v", w.Cover(), w.StashShown()) | |
| 223 | - | } | |
| 224 | - | if p := placement(w, 4); p.Hidden { | |
| 225 | - | t.Fatalf("captured hidden %+v", p) | |
| 226 | - | } | |
| 227 | - | if p := placement(w, 1); p.Hidden || !p.Fullscreen { | |
| 228 | - | t.Fatalf("cover hidden %+v", p) | |
| 229 | - | } | |
| 230 | - | } | |
| 231 | 214 | ||
| 232 | 215 | }) | |
| 233 | 216 | }) | |
| @@ -196,12 +196,6 @@ func TestStashCapture(t *testing.T) { | |||||
| 196 | {"dialog keeps focus", OverflowScroll, func(m *Monitor) { m.AddFloating(9, 10, 10) }, true, 9}, | 196 | {"dialog keeps focus", OverflowScroll, func(m *Monitor) { m.AddFloating(9, 10, 10) }, true, 9}, | ||
| 197 | {"hidden", OverflowScroll, func(m *Monitor) { m.Current().ToggleStashVisible() }, false, 4}, | 197 | {"hidden", OverflowScroll, func(m *Monitor) { m.Current().ToggleStashVisible() }, false, 4}, | ||
| 198 | {"under fullscreen", OverflowScroll, func(m *Monitor) { m.Current().SetFullscreen(3, true) }, false, 3}, | 198 | {"under fullscreen", OverflowScroll, func(m *Monitor) { m.Current().SetFullscreen(3, true) }, false, 3}, | ||
| 199 | - | {"shown over fullscreen", OverflowScroll, func(m *Monitor) { | |||
| 200 | - | w := m.Current() | |||
| 201 | - | w.FocusID(1) | |||
| 202 | - | w.SetFullscreen(1, true) | |||
| 203 | - | w.ToggleStashVisible() | |||
| 204 | - | }, true, 4}, | |||
| 205 | {"off", OverflowScroll, func(m *Monitor) { m.SetStashCapture(false) }, false, 3}, | 199 | {"off", OverflowScroll, func(m *Monitor) { m.SetStashCapture(false) }, false, 3}, | ||
| 206 | } { | 200 | } { | ||
| 207 | t.Run(tc.name, func(t *testing.T) { | 201 | t.Run(tc.name, func(t *testing.T) { | ||
| @@ -217,17 +211,6 @@ func TestStashCapture(t *testing.T) { | |||||
| 217 | if id, _ := w.Focused(); id != tc.focused { | 211 | if id, _ := w.Focused(); id != tc.focused { | ||
| 218 | t.Fatalf("focused %d", id) | 212 | t.Fatalf("focused %d", id) | ||
| 219 | } | 213 | } | ||
| 220 | - | if tc.name == "shown over fullscreen" { | |||
| 221 | - | if w.Cover() != 1 || !w.StashShown() { | |||
| 222 | - | t.Fatalf("cover %d shown %v", w.Cover(), w.StashShown()) | |||
| 223 | - | } | |||
| 224 | - | if p := placement(w, 4); p.Hidden { | |||
| 225 | - | t.Fatalf("captured hidden %+v", p) | |||
| 226 | - | } | |||
| 227 | - | if p := placement(w, 1); p.Hidden || !p.Fullscreen { | |||
| 228 | - | t.Fatalf("cover hidden %+v", p) | |||
| 229 | - | } | |||
| 230 | - | } | |||
| 231 | 214 | ||||
| 232 | }) | 215 | }) | ||
| 233 | }) | 216 | }) | ||
M internal/core/workspace/stash.go +6 -5
| @@ -67,8 +67,8 @@ func (w *Workspace) addStash(f Float) { | |||
| 67 | 67 | ||
| 68 | 68 | // CaptureStash puts a new window id in the shown stash, selected, and | |
| 69 | 69 | // reports whether it did. Like a new tile, it leaves a focused native | |
| 70 | - | // float focused. A stash shown over a covering fullscreen window captures | |
| 71 | - | // too; one hidden under the cover does not, and the window tiles. | |
| 70 | + | // float focused. Under a covering fullscreen window the stash is not on | |
| 71 | + | // screen: the window tiles as usual. | |
| 72 | 72 | func (w *Workspace) CaptureStash(id WindowID) bool { | |
| 73 | 73 | if id == 0 || !w.StashCaptures() { | |
| 74 | 74 | return false | |
| @@ -80,9 +80,10 @@ func (w *Workspace) CaptureStash(id WindowID) bool { | |||
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | // StashCaptures reports whether a new window would be captured by the | |
| 83 | - | // stash (CaptureStash): whenever the stash is on screen (StashShown), | |
| 84 | - | // including shown over a covering fullscreen window. | |
| 85 | - | func (w *Workspace) StashCaptures() bool { return w.StashShown() } | |
| 83 | + | // stash (CaptureStash): it is shown and no fullscreen window covers it. | |
| 84 | + | func (w *Workspace) StashCaptures() bool { | |
| 85 | + | return !w.stashHidden && len(w.Stash) > 0 && w.Cover() == 0 | |
| 86 | + | } | |
| 86 | 87 | ||
| 87 | 88 | // StashSpawned puts a window opened by a stash spawn in the stash, selected | |
| 88 | 89 | // and focused, with no former column: toggle-window-stash tiles it as a new | |
| @@ -67,8 +67,8 @@ func (w *Workspace) addStash(f Float) { | |||||
| 67 | 67 | ||||
| 68 | // CaptureStash puts a new window id in the shown stash, selected, and | 68 | // CaptureStash puts a new window id in the shown stash, selected, and | ||
| 69 | // reports whether it did. Like a new tile, it leaves a focused native | 69 | // reports whether it did. Like a new tile, it leaves a focused native | ||
| 70 | - | // float focused. A stash shown over a covering fullscreen window captures | 70 | + | // float focused. Under a covering fullscreen window the stash is not on |
| 71 | - | // too; one hidden under the cover does not, and the window tiles. | 71 | + | // screen: the window tiles as usual. |
| 72 | func (w *Workspace) CaptureStash(id WindowID) bool { | 72 | func (w *Workspace) CaptureStash(id WindowID) bool { | ||
| 73 | if id == 0 || !w.StashCaptures() { | 73 | if id == 0 || !w.StashCaptures() { | ||
| 74 | return false | 74 | return false | ||
| @@ -80,9 +80,10 @@ func (w *Workspace) CaptureStash(id WindowID) bool { | |||||
| 80 | } | 80 | } | ||
| 81 | 81 | ||||
| 82 | // StashCaptures reports whether a new window would be captured by the | 82 | // StashCaptures reports whether a new window would be captured by the | ||
| 83 | - | // stash (CaptureStash): whenever the stash is on screen (StashShown), | 83 | + | // stash (CaptureStash): it is shown and no fullscreen window covers it. |
| 84 | - | // including shown over a covering fullscreen window. | 84 | + | func (w *Workspace) StashCaptures() bool { |
| 85 | - | func (w *Workspace) StashCaptures() bool { return w.StashShown() } | 85 | + | return !w.stashHidden && len(w.Stash) > 0 && w.Cover() == 0 |
| 86 | + | } | |||
| 86 | 87 | ||||
| 87 | // StashSpawned puts a window opened by a stash spawn in the stash, selected | 88 | // StashSpawned puts a window opened by a stash spawn in the stash, selected | ||
| 88 | // and focused, with no former column: toggle-window-stash tiles it as a new | 89 | // and focused, with no former column: toggle-window-stash tiles it as a new | ||
M tools/go.mod +2 -2
| @@ -42,8 +42,8 @@ require ( | |||
| 42 | 42 | golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect | |
| 43 | 43 | golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect | |
| 44 | 44 | golang.org/x/mod v0.42.0 // indirect | |
| 45 | - | golang.org/x/sync v0.24.0 // indirect | |
| 46 | - | golang.org/x/sys v0.49.0 // indirect | |
| 45 | + | golang.org/x/sync v0.25.0 // indirect | |
| 46 | + | golang.org/x/sys v0.50.0 // indirect | |
| 47 | 47 | golang.org/x/term v0.47.0 // indirect | |
| 48 | 48 | golang.org/x/text v0.43.0 // indirect | |
| 49 | 49 | golang.org/x/tools v0.52.0 // indirect | |
| @@ -42,8 +42,8 @@ require ( | |||||
| 42 | golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect | 42 | golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect | ||
| 43 | golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect | 43 | golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect | ||
| 44 | golang.org/x/mod v0.42.0 // indirect | 44 | golang.org/x/mod v0.42.0 // indirect | ||
| 45 | - | golang.org/x/sync v0.24.0 // indirect | 45 | + | golang.org/x/sync v0.25.0 // indirect |
| 46 | - | golang.org/x/sys v0.49.0 // indirect | 46 | + | golang.org/x/sys v0.50.0 // indirect |
| 47 | golang.org/x/term v0.47.0 // indirect | 47 | golang.org/x/term v0.47.0 // indirect | ||
| 48 | golang.org/x/text v0.43.0 // indirect | 48 | golang.org/x/text v0.43.0 // indirect | ||
| 49 | golang.org/x/tools v0.52.0 // indirect | 49 | golang.org/x/tools v0.52.0 // indirect | ||
M tools/go.sum +4 -4 generated file: collapsed
Comments00 unresolved
no comments yet.