Skip to content

Instantly share code, notes, and snippets.

@LiQiuDGG
Last active December 25, 2025 20:38
Show Gist options
  • Select an option

  • Save LiQiuDGG/e5c20ca3c3c07c11860d5099e174ded3 to your computer and use it in GitHub Desktop.

Select an option

Save LiQiuDGG/e5c20ca3c3c07c11860d5099e174ded3 to your computer and use it in GitHub Desktop.
QuaziiUI - Search Ghost Effect Fix

QuaziiUI - Search Ghost Effect Fix

Fixes ghost rendering artifacts when switching from Search tab to General tab.


Issue

After using the Search tab (Beta), the General tab creates a ghost effect when scrolling.


Root Cause

In RenderSearchResults (qui_gui.lua:2945-2949), orphaned frames aren't properly destroyed:

-- Clear previous child frames
for _, child in ipairs({content:GetChildren()}) do
    child:Hide()
    child:SetParent(nil)  -- Orphans the frame but doesn't destroy it
end

SetParent(nil) orphans frames but doesn't destroy them. These orphaned frames can still render in unexpected places, especially when:

  1. They were created inside a scroll frame
  2. The scroll position or stacking context changes
  3. The frame's strata/level wasn't reset

Implementation

1. Replace Frame Cleanup Logic

File: utils/qui_gui.lua (around line 2945, in RenderSearchResults)

Replace:

-- Clear previous child frames
for _, child in ipairs({content:GetChildren()}) do
    child:Hide()
    child:SetParent(nil)
end

With:

-- Clear previous child frames (move off-screen instead of orphaning)
for _, child in ipairs({content:GetChildren()}) do
    child:Hide()
    child:ClearAllPoints()
    child:SetAlpha(0)
    -- Move to hidden stash frame instead of nil parent
    if not GUI._orphanStash then
        GUI._orphanStash = CreateFrame("Frame", nil, UIParent)
        GUI._orphanStash:Hide()
        GUI._orphanStash:SetPoint("TOPLEFT", UIParent, "BOTTOMRIGHT", 10000, -10000)
    end
    child:SetParent(GUI._orphanStash)
end

Summary

Aspect Implementation
Problem SetParent(nil) orphans frames without destroying
Solution Reparent to hidden stash frame instead
Target File utils/qui_gui.lua
Function RenderSearchResults (line ~2945)

The fix ensures orphaned widgets are:

  • Hidden (Hide())
  • Unanchored (ClearAllPoints())
  • Invisible (SetAlpha(0))
  • Reparented to a hidden off-screen container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment