I would not suggest to use either of the code. The first one simply doesn't handle the SetPoint hooks, which happens when boss or arena frames appera, or when you enable/disable the Blizzard side bars. The second one is a taint hazzard.
Try this code:
Lua Code:
local moving
hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(self)
if moving then
return
end
moving = true
self:SetMovable(true)
self:SetUserPlaced(true)
self:ClearAllPoints()
self:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
self:SetScale(1.1) -- optional
self:SetWidth(300) -- optional
self:SetHeight(400) -- optional
self:SetMovable(false)
moving = nil
end)
Also keep that in mind if the original parent of the frame aka the "MinimapCluster" is not in it's original position, then the client won't be able to bypass secure code for it's children frame aka the "ObjectiveTrackerFrame" and you won't be able to click on the quest items on the frame.
The only solution is that to reset the "MinimapCluster", or to use another 3rd party Minimap addon, which you can reposition securely/properly.