Fix unit frame health fills breaking on window resize - #2076
Open
robert-clayton wants to merge 1 commit into
Open
robert-clayton wants to merge 1 commit into
robert-clayton wants to merge 1 commit into
Conversation
EllesmereUIUnitFrames registered no display/scale listeners, so a pure resolution change (DISPLAY_SIZE_CHANGED, which fires without a UI-scale change) never triggered a rebuild. Health fills kept their pre-resize pixel-snapped geometry and rendered empty until a manual /reload. The main addon's scaleWatcher only re-runs the unit-frame reload through PP.SetUIScale, which a plain resize does not reach. Register DISPLAY_SIZE_CHANGED + UI_SCALE_CHANGED and re-run the existing ns.ReloadFrames on those events, deferred one frame so the new screen size settles before the rebuild reads GetPhysicalScreenSize. ReloadFrames is throttled and already combat-safe (guards restricted Show/Hide behind InCombatLockdown, defers via PLAYER_REGEN_ENABLED), so no new taint surface. SetScript is on the addon's own frame, not a Blizzard frame. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133ZDCzs57VxRJ8YL3sQ7DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Unit frame health fills render empty after the WoW window is resized, and only recover on a
/reload.EllesmereUIUnitFramesregisters no display or scale listeners, so a pure resolution change (DISPLAY_SIZE_CHANGED, which fires without a UI-scale change) never triggers a rebuild, and the bars keep their pre-resize pixel-snapped geometry. The main addon'sscaleWatcheronly re-runs the unit-frame reload throughPP.SetUIScale, which a plain resize does not reach.The fix registers
DISPLAY_SIZE_CHANGED+UI_SCALE_CHANGEDin the unit-frame addon and re-runs the existingns.ReloadFrameson those events, deferred one frame so the new screen size settles before the rebuild readsGetPhysicalScreenSize.How was it tested?
Live (Midnight 12.1) on a Hyprland/Wayland desktop, where
Super+Ftoggles the game window between windowed and fullscreen and firesDISPLAY_SIZE_CHANGED. Before the patch the fills go empty on the toggle and stay empty until/reload; after, they refill correctly on every toggle with no manual reload, in and out of combat.Screenshots
Before, using Super+F to toggle fullscreen in Hyprland:
After, using Super+F to toggle fullscreen in Hyprland:
Checklist
C_Timer.After(0)is a one-shot next-frame defer, not a recurring timer gate.SetScriptis on the addon's ownCreateFrame("Frame"), never a Blizzard frame. Reusesns.ReloadFrames, already combat-safe (its throttle guards restricted Show/Hide behindInCombatLockdownand defers viaPLAYER_REGEN_ENABLED), so no new taint surface.