fix(core): use value-type motions in Monitor.settled after rebase on main
- commit
- 724608c096514f7a73dfd5397e74859b9056887d
- author
- brice · · 2026-10-04 15:47 UTC
- committer
- brice · · 2026-10-04 19:08 UTC
- parent
- c0fdb38
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +3 -3
M internal/core/pulse.go +2 -2
| @@ -139,11 +139,11 @@ func (c *Core) advancePulse(now time.Time) float64 { | |||
| 139 | 139 | ||
| 140 | 140 | // settled reports whether no swipe or slide moves the monitor's layout. | |
| 141 | 141 | func (m *Monitor) settled() bool { | |
| 142 | - | if m.switchMotion != nil || m.switchOff != 0 { | |
| 142 | + | if m.switchMotion.on || m.switchOff != 0 { | |
| 143 | 143 | return false | |
| 144 | 144 | } | |
| 145 | 145 | for w := range m.all() { | |
| 146 | - | if w.motion != nil || w.shift != 0 { | |
| 146 | + | if w.motion.on || w.shift != 0 { | |
| 147 | 147 | return false | |
| 148 | 148 | } | |
| 149 | 149 | } | |
| @@ -139,11 +139,11 @@ func (c *Core) advancePulse(now time.Time) float64 { | |||||
| 139 | 139 | ||||
| 140 | // settled reports whether no swipe or slide moves the monitor's layout. | 140 | // settled reports whether no swipe or slide moves the monitor's layout. | ||
| 141 | func (m *Monitor) settled() bool { | 141 | func (m *Monitor) settled() bool { | ||
| 142 | - | if m.switchMotion != nil || m.switchOff != 0 { | 142 | + | if m.switchMotion.on || m.switchOff != 0 { |
| 143 | return false | 143 | return false | ||
| 144 | } | 144 | } | ||
| 145 | for w := range m.all() { | 145 | for w := range m.all() { | ||
| 146 | - | if w.motion != nil || w.shift != 0 { | 146 | + | if w.motion.on || w.shift != 0 { |
| 147 | return false | 147 | return false | ||
| 148 | } | 148 | } | ||
| 149 | } | 149 | } | ||
M internal/core/pulse_test.go +1 -1
| @@ -193,7 +193,7 @@ func TestFocusPulseWaitsForSlide(t *testing.T) { | |||
| 193 | 193 | slide func(*Monitor, time.Time) | |
| 194 | 194 | alone bool | |
| 195 | 195 | }{ | |
| 196 | - | {"workspace landing, alone", func(m *Monitor, now time.Time) { m.switchMotion = newMotion(workspaceSpring(0.5, 0), now) }, true}, | |
| 196 | + | {"workspace landing, alone", func(m *Monitor, now time.Time) { m.switchMotion = newMotion(workspaceSpring(0.5, 0), now, 1) }, true}, | |
| 197 | 197 | {"workspace drag, alone", func(m *Monitor, _ time.Time) { m.switchOff = 0.3 }, true}, | |
| 198 | 198 | {"column drag, beside another", func(m *Monitor, _ time.Time) { m.Current().shift = 40 }, false}, | |
| 199 | 199 | } { | |
| @@ -193,7 +193,7 @@ func TestFocusPulseWaitsForSlide(t *testing.T) { | |||||
| 193 | slide func(*Monitor, time.Time) | 193 | slide func(*Monitor, time.Time) | ||
| 194 | alone bool | 194 | alone bool | ||
| 195 | }{ | 195 | }{ | ||
| 196 | - | {"workspace landing, alone", func(m *Monitor, now time.Time) { m.switchMotion = newMotion(workspaceSpring(0.5, 0), now) }, true}, | 196 | + | {"workspace landing, alone", func(m *Monitor, now time.Time) { m.switchMotion = newMotion(workspaceSpring(0.5, 0), now, 1) }, true}, |
| 197 | {"workspace drag, alone", func(m *Monitor, _ time.Time) { m.switchOff = 0.3 }, true}, | 197 | {"workspace drag, alone", func(m *Monitor, _ time.Time) { m.switchOff = 0.3 }, true}, | ||
| 198 | {"column drag, beside another", func(m *Monitor, _ time.Time) { m.Current().shift = 40 }, false}, | 198 | {"column drag, beside another", func(m *Monitor, _ time.Time) { m.Current().shift = 40 }, false}, | ||
| 199 | } { | 199 | } { | ||