Quantcast

Tweak to Menu Bar fix

urnati [11-25-18 - 12:10]
Tweak to Menu Bar fix
Change Location to use the intended Movable routine
Filename
Titan/TitanMovable.lua
TitanLocation/TitanLocation.lua
diff --git a/Titan/TitanMovable.lua b/Titan/TitanMovable.lua
index 7311183..aaa7e1d 100755
--- a/Titan/TitanMovable.lua
+++ b/Titan/TitanMovable.lua
@@ -153,7 +153,7 @@ OUT: boolean - true to adjust, false if not
 local function DoAdjust(place, force)
 	local res = false -- assume we will not adjust
 	-- force is passed to cover cases where the user has just deselected both top or bottom bars
-	-- When that happens we need to still adjust
+	-- When that happens we need to adjust

 	-- We did it to ourselves - if (Aux)ScreenAdjust is true it means the user wants Titan to NOT adjust...
 	if place == TITAN_PANEL_PLACE_TOP then
@@ -188,11 +188,6 @@ VAR: ... - list of frame position info
 NOTE:
 Swiped from Vrul on wowinterface forum

-Setting the MainMenuBar was needed because in 8.0.0 Blizzard changed something in the
-way they controlled the frame. With Titan panel and bottom bars the MainMenuBar
-would 'bounce'. Figuring out what the root cause was a bust.
-This fix of setting user placed came from a Titan user.
-
 The table UIPARENT_MANAGED_FRAME_POSITIONS does not hold all Blizzard frames.
 It is cleared for each frame in case the frame is in or might be in the table in the future.
 :NOTE
@@ -559,13 +554,7 @@ function TitanPanel_AdjustFrames(force)
 	-- force is passed to cover cases where Titan should always adjust
 	-- such as when the user has just deselected both top or bottom bars
 	local f = force or false -- do not require the parameter
-if InCombatLockdown() then
-TitanDebug("_AdjustFrames"
-.." "..tostring(ActionBarBusy())
-.." MMB:"..tostring(MainMenuBar:IsShown())
-.." OAB:"..tostring(OverrideActionBar:IsShown())
-, "warning")
-end
+
 	-- Adjust frame positions top and bottom based on user choices
 	TitanMovableFrame_MoveFrames(f)
 end
@@ -609,6 +598,18 @@ NOTE:
 :NOTE
 --]]
 function TitanMovable_SecureFrames()
+	--[[
+	Setting the MainMenuBar as user placed was needed because in 8.0.0 Blizzard changed something in the
+	way they controlled the frame. With Titan panel and bottom bars the MainMenuBar
+	would 'bounce'. Figuring out the true root cause was a bust.
+	This fix idea came from a Titan user who is an addon developer. Although it seems a bit of a hack.
+
+	Later Titan checks rely on the user placed flag so it needs to be set early.
+	--]]
+	MainMenuBar:SetMovable(true);
+	MainMenuBar:SetUserPlaced(true);
+	MainMenuBar:SetMovable(false);
+
 	if not TitanPanelAce:IsHooked("FCF_UpdateDockPosition", Titan_FCF_UpdateDockPosition) then
 		TitanPanelAce:SecureHook("FCF_UpdateDockPosition", Titan_FCF_UpdateDockPosition) -- FloatingChatFrame
 	end
diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua
index 9189595..dc85e9d 100755
--- a/TitanLocation/TitanLocation.lua
+++ b/TitanLocation/TitanLocation.lua
@@ -427,7 +427,7 @@ function TitanPanelLocationButton_LocOnMiniMap()
 		MiniMapWorldMapButton:Hide()
 	end
 	-- adjust MiniMap frame if needed
-	TitanPanel_AdjustFrames();
+	TitanPanel_AdjustFrames(false);
 end

 -- **************************************************************************