Skip to content

Fix(QoL): Shifter pulls back windows kept hidden off screen - #3423

Open
svart2521 wants to merge 1 commit into
EllesmereGaming:mainfrom
svart2521:bug#366
Open

svart2521 wants to merge 1 commit into
EllesmereGaming:mainfrom
svart2521:bug#366

Conversation

@svart2521

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes Shifter bringing back Blizzard windows that are kept open but deliberately hidden (https://ellesmereui.com/bugs/366). Some windows have to stay shown while hidden, because their events and server session are still needed, so they are moved far off screen or scaled down to almost nothing. Shifter brought them back into view, often raised above other windows, where they caught clicks meant for those windows.

Cause: Shifter treats every window it manages the same way, whether it is visible or not.

  • HookFrame turns on screen clamping for each window, so a window placed off screen is pulled back to the screen edge, even if it was never moved with Shifter.
  • The SetPoint and SetScale hooks re-apply the saved position and scale after any outside change, which undoes the hide.
  • The OnShow paths lift the strata and Raise() the window above the others.

Fix: Shifter now recognises a hidden window and leaves it alone until it comes back.

  • IsParked detects a window anchored far beyond the screen or lying entirely off it, and IsHiddenByScale detects a scale far below anything Shifter itself sets.
  • SyncParkState checks this in the SetPoint hook for outside changes only (after the _shIgnoreSP guard), stores the result on the frame data, and switches the screen clamp off while the window is hidden.
  • While a window is hidden, ApplyPosition, ApplyScale, ShouldDock and the OnShow raise all return early.
  • When the window is placed back on screen, the clamp, the saved scale and the saved position are restored. A saved position that ends up off screen is still pulled back by the clamp as before.

Cost: one GetPoint and a little arithmetic per SetPoint on a Shifter-managed window, with no allocations. Nothing changes while Shifter is disabled at login.

How was it tested?

Client: Retail and Forever

  • Opened a profession window, a merchant and the auction house while their Blizzard windows were kept shown but hidden off screen (the auction house also scaled down): they stayed hidden and caught no clicks.
  • Same with those windows previously moved with Shifter: they stayed hidden, and came back at the saved position and scale once shown normally again.
  • Moved and scaled other Shifter windows (character frame, default positions): unchanged.
  • Guardrails and the locale-key check pass.

Checklist

  • New settings default OFF (no behavior change without opt-in) - N/A, no new settings
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames
  • Tested in-game on live; no version gates or pre-Midnight APIs added

## What does this PR do?

Fixes Shifter bringing back Blizzard windows that are kept open but deliberately hidden (https://ellesmereui.com/bugs/366). Some windows have to stay shown while hidden, because their events and server session are still needed, so they are moved far off screen or scaled down to almost nothing. Shifter brought them back into view, often raised above other windows, where they caught clicks meant for those windows.

Cause: Shifter treats every window it manages the same way, whether it is visible or not.
- `HookFrame` turns on screen clamping for each window, so a window placed off screen is pulled back to the screen edge, even if it was never moved with Shifter.
- The `SetPoint` and `SetScale` hooks re-apply the saved position and scale after any outside change, which undoes the hide.
- The `OnShow` paths lift the strata and `Raise()` the window above the others.

Fix: Shifter now recognises a hidden window and leaves it alone until it comes back.
- `IsParked` detects a window anchored far beyond the screen or lying entirely off it, and `IsHiddenByScale` detects a scale far below anything Shifter itself sets.
- `SyncParkState` checks this in the `SetPoint` hook for outside changes only (after the `_shIgnoreSP` guard), stores the result on the frame data, and switches the screen clamp off while the window is hidden.
- While a window is hidden, `ApplyPosition`, `ApplyScale`, `ShouldDock` and the `OnShow` raise all return early.
- When the window is placed back on screen, the clamp, the saved scale and the saved position are restored. A saved position that ends up off screen is still pulled back by the clamp as before.

Cost: one `GetPoint` and a little arithmetic per `SetPoint` on a Shifter-managed window, with no allocations. Nothing changes while Shifter is disabled at login.

## How was it tested?

Client: Retail and Forever

- Opened a profession window, a merchant and the auction house while their Blizzard windows were kept shown but hidden off screen (the auction house also scaled down): they stayed hidden and caught no clicks.
- Same with those windows previously moved with Shifter: they stayed hidden, and came back at the saved position and scale once shown normally again.
- Moved and scaled other Shifter windows (character frame, default positions): unchanged.
- Guardrails and the locale-key check pass.

## Checklist

- [x] New settings default **OFF** (no behavior change without opt-in) - N/A, no new settings
- [x] Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue
- [x] Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
- [x] No writes onto Blizzard-owned frames (weak-table pattern used); `HookScript`/`hooksecurefunc` only, never `SetScript` on Blizzard frames
- [x] Tested in-game on live; no version gates or pre-Midnight APIs added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant