Using a dual screen setup certain parts of the standard interface are ... very bad placed.
I successfully moved the worldscreen to only one screen.
However many things don't follow.
One example is the FramerateLabel (for me I is shown with CTRL+R).
By default it is anchored to BOTTOM, UIPARENT, BOTTOM, 0, 135 which happens to be in the middle (left-right) of the virtual screen. Unfortunately that corresponds to the exact place where the gap between the two physical screens is.
I can move this to a more suitable place.
So far so good.
However after some time the FramerateLabel moves back to the original position. This is what surprises me, because I could not find the cause.
To find it I tried replacing FramerateLabel.SetPoint, but somehow this has not helped me.
Edit 1:
What I also know: This happens whenever I have a loading screen. also at some other times. Apparently some Blizzard code resets the anchors. I tried to solve this by replacing SetPoint, but apparently I am doing it wrong.
Edit2:
This is part of my code for the replacement function for SetPoint
if frame:GetName() == "FramerateLabel" then
ChatFrame1:AddMessage("A" .. (relativeFrame and relativeFrame.GetName and relativeFrame:GetName() or tostring(relativeFrame)))
end
local newRelativeFrame = relativeFrame
if relativeFrame == UIParent then
if frame:GetName() == "FramerateLabel" then
ChatFrame1:AddMessage("changing")
end
newRelativeFrame = WorldFrame
else
if frame:GetName() == "FramerateLabel" then
ChatFrame1:AddMessage("not UIParent, not changing")
end
end
local original = originalSetPoint[frame]
assert(original)
if frame:GetName() == "FramerateLabel" then
ChatFrame1:AddMessage("B" .. (newRelativeFrame and newRelativeFrame.GetName and newRelativeFrame:GetName() or tostring(newRelativeFrame)))
end
FramerateLabel is listed in UIPARENT_MANAGED_FRAME_POSITIONS in UIParent.lua, which means the default UI moves it around based on which other things are hidden/shown. If you want to stop it from doing that, do this:
FramerateLabel.ignoreFramePositionManager = true
If you want to let it keep adjusting the vertical position, but place it horizontally relative to the WorldFrame instead of UIParent, this might work:
hooksecurefunc("UIParent_ManageFramePosition", function(index, ...)
if index == "FramerateLabel" then
local a, parent, b, x, y = FramerateLabel:GetPoint(1)
FramerateLabel:SetPoint(a, WorldFrame, b, x, y)
end
end)
I found my mistake... really stupid:
Turns out that "UIParent" and UIParent are not equal (we all knew that...).
But unfortunately may check assumed that the relative frame was always a frame, but sometimes it is a string.
I successfully moved the worldscreen to only one screen.
However many things don't follow.
One example is the FramerateLabel (for me I is shown with CTRL+R).
By default it is anchored to BOTTOM, UIPARENT, BOTTOM, 0, 135 which happens to be in the middle (left-right) of the virtual screen. Unfortunately that corresponds to the exact place where the gap between the two physical screens is.
Using (from memory)
I can move this to a more suitable place.
So far so good.
However after some time the FramerateLabel moves back to the original position. This is what surprises me, because I could not find the cause.
To find it I tried replacing FramerateLabel.SetPoint, but somehow this has not helped me.
Edit 1:
What I also know: This happens whenever I have a loading screen. also at some other times. Apparently some Blizzard code resets the anchors. I tried to solve this by replacing SetPoint, but apparently I am doing it wrong.
Edit2:
This is part of my code for the replacement function for SetPoint
The strange thing is that I get
If you want to let it keep adjusting the vertical position, but place it horizontally relative to the WorldFrame instead of UIParent, this might work:
I was able to reproduce that indeed UIParent_ManageFramePosition is (at least one of) the cause.
(Using
to get a stacktrace.)
I'm still not sure why my approach does not work, but I will give your idea a try.
Turns out that "UIParent" and UIParent are not equal (we all knew that...).
But unfortunately may check assumed that the relative frame was always a frame, but sometimes it is a string.