This is the drag function I am using in a lot of my addons to make them movable via lock/unlock slash command.
https://github.com/zorker/rothui/blo...gframe.lua#L58
If I remember correctly both SetUserPlaced and SetMovable have to be in place.
Lua Code:
frame:SetMovable(true)
frame:SetUserPlaced(true)
It is important to note that you must load those settings when you initialize the addon. If you delay the call until PLAYER_LOGIN it will not work. Somewhere in the time from init to login the layout-local.txt is applied.