fix(daemon): reapply the session theme once the floating spare is published
- commit
- e16502ca1030f8c44c6ba6c4295ad2042102b0d9
- author
- brice · · 2026-10-08 08:56 UTC
- committer
- brice · · 2026-10-08 09:31 UTC
- parent
- 1d86a91
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +7 -0
M internal/usecase/daemon/floating_spare.go +7 -0
| @@ -85,9 +85,11 @@ func (d *Daemon) ensureFloatingSpare(sess *session, tb *tab) { | |||
| 85 | 85 | // starts with the session theme, as a new tab does. | |
| 86 | 86 | d.applySessionThemeToPane(sess, p) | |
| 87 | 87 | } | |
| 88 | + | var published *pane | |
| 88 | 89 | sess.floatingLaunchMu.Lock() | |
| 89 | 90 | sess.floatingSpareStarting = false | |
| 90 | 91 | if p != nil && !sess.floatingLaunchStopping { | |
| 92 | + | published = p | |
| 91 | 93 | sess.floatingSpare = &floatingSpare{pane: p, key: spareKey(spec)} | |
| 92 | 94 | p.prestarted = true | |
| 93 | 95 | spare := p | |
| @@ -108,6 +110,11 @@ func (d *Daemon) ensureFloatingSpare(sess *session, tb *tab) { | |||
| 108 | 110 | if p != nil { | |
| 109 | 111 | closeFloatingPane(p) | |
| 110 | 112 | } | |
| 113 | + | if published != nil { | |
| 114 | + | // A theme change between the first apply and publication could | |
| 115 | + | // not see the spare; any later one does, so apply once more. | |
| 116 | + | d.applySessionThemeToPane(sess, published) | |
| 117 | + | } | |
| 111 | 118 | }) | |
| 112 | 119 | } | |
| 113 | 120 | ||
| @@ -85,9 +85,11 @@ func (d *Daemon) ensureFloatingSpare(sess *session, tb *tab) { | |||||
| 85 | // starts with the session theme, as a new tab does. | 85 | // starts with the session theme, as a new tab does. | ||
| 86 | d.applySessionThemeToPane(sess, p) | 86 | d.applySessionThemeToPane(sess, p) | ||
| 87 | } | 87 | } | ||
| 88 | + | var published *pane | |||
| 88 | sess.floatingLaunchMu.Lock() | 89 | sess.floatingLaunchMu.Lock() | ||
| 89 | sess.floatingSpareStarting = false | 90 | sess.floatingSpareStarting = false | ||
| 90 | if p != nil && !sess.floatingLaunchStopping { | 91 | if p != nil && !sess.floatingLaunchStopping { | ||
| 92 | + | published = p | |||
| 91 | sess.floatingSpare = &floatingSpare{pane: p, key: spareKey(spec)} | 93 | sess.floatingSpare = &floatingSpare{pane: p, key: spareKey(spec)} | ||
| 92 | p.prestarted = true | 94 | p.prestarted = true | ||
| 93 | spare := p | 95 | spare := p | ||
| @@ -108,6 +110,11 @@ func (d *Daemon) ensureFloatingSpare(sess *session, tb *tab) { | |||||
| 108 | if p != nil { | 110 | if p != nil { | ||
| 109 | closeFloatingPane(p) | 111 | closeFloatingPane(p) | ||
| 110 | } | 112 | } | ||
| 113 | + | if published != nil { | |||
| 114 | + | // A theme change between the first apply and publication could | |||
| 115 | + | // not see the spare; any later one does, so apply once more. | |||
| 116 | + | d.applySessionThemeToPane(sess, published) | |||
| 117 | + | } | |||
| 111 | }) | 118 | }) | ||
| 112 | } | 119 | } | ||
| 113 | 120 | ||||