Commit 5eaed9a
committed
Clean up Joystick parent-child on red-X dismissal
JoystickConfigurationController previously did its parent-child
teardown in -cancel:, leaving the red-X dismissal path (and the
Preferences-close cascade) without a removeChildWindow:. The stale
relationship was reconciled on the next showWindow: by the parent
check, so the bug was invisible in practice — but the asymmetry
diverged from the close-path matrix in spec 004 which mandates a
single teardown hook for every closable-with-pause-or-parent panel.
Add an NSWindowWillCloseNotification observer in showWindow:; route
the unpin through handleWillClose: so every dismissal path (Apply,
Cancel, red X, Preferences close cascade) does the same teardown.
Joystick is the only utility window whose showWindow: can run a
second time without an intervening close: re-clicking Configure for
the other joystick reuses the same instance, switching contents via
sender's tag. The spec explicitly disallows a singleton early-return
guard here. To keep observer registration idempotent across that
switch, remove any prior registration before adding.1 parent 7d2224b commit 5eaed9a
1 file changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
161 | 175 | | |
162 | 176 | | |
163 | 177 | | |
| |||
176 | 190 | | |
177 | 191 | | |
178 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
179 | 207 | | |
180 | 208 | | |
181 | 209 | | |
| |||
0 commit comments