You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move GUI:CloseAllMenus back resident, with its registry
Four lines, and having them in the companion split a three-part unit across an
addon boundary for no benefit: the registry table and RegisterMenu were
resident while the only thing that reads the registry was not. Resident code
could add a menu but not close one, and resident CreateDropdown does register
(the mover panel's anchor dropdown is a resident caller).
Nothing was broken -- both callers are companion-side, so reader and callers
loaded together -- but the failure mode if anyone had reached for it from
resident code was the bad kind: a bulk 'dismiss whatever is open' call that is
nil half the time fails SILENTLY, leaving a menu floating, which is the exact
symptom the registry exists to prevent.
Taking the fix rather than documenting the wart, which is also the lesson from
the two ORDER-IS-LOAD-BEARING claims this review found to be false: a comment
describing a split is worse than not having the split.
gui-conventions.md updated to match -- it now says all three pieces are
resident and should stay together, keeps the reasoning as a note on why, and
still distinguishes CloseAllMenus from CloseOpenDropdown (resident, on _priv,
the single-open-dropdown case most call sites actually want).
Copy file name to clipboardExpand all lines: docs/gui-conventions.md
+25-29Lines changed: 25 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,7 @@ one surface behave unlike the rest of the addon.
182
182
183
183
| Need | Helper | ☠ What breaks if you skip it |
184
184
|------|--------|------------------------------|
185
-
| A dropdown-style popup menu |`GUI:RegisterMenu(frame)` — resident; `GUI:CloseAllMenus()` — **companion-only, see below**|**Register every menu frame at creation.** A menu that isn't registered stays open through a page change, mode switch or window close, and floats over whatever comes next |
185
+
| A dropdown-style popup menu |`GUI:RegisterMenu(frame)`, `GUI:CloseAllMenus()`|**Register every menu frame at creation.** A menu that isn't registered stays open through a page change, mode switch or window close, and floats over whatever comes next |
186
186
| A widget that changes height |`GUI:RelayoutHost(widget, slotHeight)`| Updates the group's stored slot, re-lays the group, **then bubbles to the page** so sibling groups re-anchor. Without the bubble a grown group's backdrop overshoots the next group's anchor and paints an empty rectangle above it |
187
187
| A border on a bespoke frame |`GUI:ApplyPixelBorder(frame, {r,g,b,a}, weight)`, `GUI:HidePixelBorder(frame)`, `GUI:RefreshPixelBorders()`| Our two-device-pixel border. A `SetBackdrop` edge instead gives you the thinning / vanishing hairline the whole system exists to avoid — see "The pixel grid" |
188
188
| Whole-pixel geometry |`GUI.SnapLen`, `GUI.SnapLenUp`| Right/top edges land mid-pixel and clip whatever they contain |
@@ -192,36 +192,32 @@ one surface behave unlike the rest of the addon.
192
192
| Colour-picker interop |`GUI:InstallColorPickerHook()` / `Uninstall…` / `IsColorPickerHookInstalled()` / `MarkColorPickerCall()`| Keeps Blizzard's picker from stomping our own; mark your call or the hook can't tell whose it is |
193
193
| Section collapse state |`GUI:GetCollapsedGroups()`| Persisted collapse state — read it, don't track your own |
194
194
195
-
### ⚠ The menu registry straddles the addon boundary
195
+
### The menu registry — all three pieces are resident
196
196
197
-
The three pieces of the menu system do not live together, which the table above
198
-
cannot show:
197
+
The registry table, its writer and its reader live together in
198
+
`DandersFrames/GUI/Widgets.lua`, and they should stay that way:
199
199
200
-
| Piece | Where | Loads |
201
-
|---|---|---|
202
-
|`GUI._menus` (the registry table) |`DandersFrames/GUI/Widgets.lua`| always |
0 commit comments