Here’s a
RedGuides-ready post — formatted in their typical style (clear problem → cause → fix → snippet → why it works).
You can copy/paste this directly into a thread or resource comment.
🛠 BoxHud Invisible / Off-Screen Fix (After Monitor / KVM / Resolution Change)
Issue
BoxHud is running (/
Lua list shows it active), but the window is not visible anywhere inside EverQuest.
Other ImGui
Lua apps are visible.
Toggling /boxhud does nothing.
Cause
BoxHud restores saved window coordinates (window.pos) on startup.
If you:
- Unplug/replug monitors
- Use a KVM switch
- Change resolution
- Switch fullscreen ↔ windowed
- Change DPI scaling
The saved X/Y position can now be outside the active ImGui viewport.
Because BoxHud restores the position using ImGuiCond.Once, it keeps reapplying the invalid off-screen coordinates every time it loads.
So it’s technically drawing — just somewhere you can’t see.
Permanent Fix (No More Deleting imgui.ini)
Add viewport clamping before calling ImGui.SetNextWindowPos().
In boxhud.
Lua, inside HUDGUI, replace the SavePos block with:
local function ClampWindowToViewport(window)<br> local vp = ImGui.GetMainViewport()<br><br> local safeX = vp.WorkPos.x + 100<br> local safeY = vp.WorkPos.y + 100<br><br> if not window.pos then<br> window.pos = {x = safeX, y = safeY}<br> return<br> end<br><br> local x = window.pos.x<br> local y = window.pos.y<br><br> local minX = vp.WorkPos.x<br> local minY = vp.WorkPos.y<br> local maxX = vp.WorkPos.x + vp.WorkSize.x - 50<br> local maxY = vp.WorkPos.y + vp.WorkSize.y - 50<br><br> if x < minX or x > maxX or y < minY or y > maxY then<br> window.pos = {x = safeX, y = safeY}<br> end<br>end<br>
Then call it before ImGui.SetNextWindowPos():
if not ImGui.IsWindowDocked() and window.SavePos then<br> ClampWindowToViewport(window)<br><br> if window.pos then<br> ImGui.SetNextWindowPos(<br> ImVec2(window.pos.x, window.pos.y),<br> ImGuiCond.Once<br> )<br> end<br><br> if window.size then<br> ImGui.SetNextWindowSize(<br> ImVec2(window.size.w, window.size.h),<br> ImGuiCond.Once<br> )<br> end<br>end<br>
Result
- BoxHud will never spawn off-screen again
- Survives monitor/KVM/resolution changes
- Does NOT break docking
- Does NOT break saved layouts
- No need to delete imgui.ini
- No need to wipe state files
Why This Works
We validate saved window.pos against:
ImGui.GetMainViewport().WorkPos<br>ImGui.GetMainViewport().WorkSize<br>
If the saved coordinates are outside the visible render area, we reset them to a safe offset inside the viewport.
This makes BoxHud self-healing instead of blindly trusting stale saved coordinates.