diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 1b87f20d12af934d41db8c42fcf80c5f327da4ec..d8e035a320370fd1ca45d79e3a3dbefcc6c618c8 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -41,7 +41,7 @@
 // LLCommandId class
 //
 
-const LLCommandId LLCommandId::null("null command");
+const LLCommandId LLCommandId::null = LLCommandId();
 
 //
 // LLCommand class
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 8f9f956ec7eabda5a1847aa13f445194d28c63d7..fdad7cd1b5a7acef14c26e689b6fce9e78b1d3f5 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -50,6 +50,12 @@ class LLCommandId
 		{}
 	};
 
+	LLCommandId()
+		: mName("null command")
+	{
+		mUUID = LLUUID::generateNewID(mName);
+	}
+	
 	LLCommandId(const std::string& name)
 		: mName(name)
 	{
@@ -62,10 +68,9 @@ class LLCommandId
 		mUUID = LLUUID::generateNewID(p.name);
 	}
 
-	LLCommandId(const LLUUID& uuid)
-	:	mName(""),
+	LLCommandId(const std::string& name, const LLUUID& uuid)
+	:	mName(name),
 		mUUID(uuid)
-	
 	{
 	}
 	
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 5f7afb07fc050155fa7f8d6cbc2103c81be6f53e..6332b2674ad31b099368e6d7ab5adf05b16425e7 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -33,6 +33,7 @@
 #include "llcommandmanager.h"
 #include "llmenugl.h"
 #include "lltrans.h"
+#include "llinventory.h"
 
 // uncomment this and remove the one in llui.cpp when there is an external reference to this translation unit
 // thanks, MSVC!
@@ -113,6 +114,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
 {
 	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text;
 	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;
+	mDraggedCommand = LLCommandId::null;
+	mRank = 0;
 }
 
 LLToolBar::~LLToolBar()
@@ -203,17 +206,24 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)
 {
 	LLCommand * command = LLCommandManager::instance().getCommand(commandId);
 	if (!command) return false;
-
+	llinfos << "Merov debug : addCommand, " << commandId.name() << ", " << commandId.uuid() << llendl;
+	
 	// Create the button and do the things that don't need ordering
 	LLToolBarButton* button = createButton(commandId);
 	mButtonPanel->addChild(button);
-	mButtonMap.insert(std::make_pair(commandId, button));
+	LLCommandId temp_command = commandId;
+	if (commandId.name() == "Drag Tool")
+	{
+		temp_command = LLCommandId("Drag Tool");
+	}
+	mButtonMap.insert(std::make_pair(temp_command.uuid(), button));
+
 
 	// Insert the command and button in the right place in their respective lists
 	if ((rank >= mButtonCommands.size()) || (rank < 0))
 	{
 		// In that case, back load
-		mButtonCommands.push_back(commandId);
+		mButtonCommands.push_back(temp_command);
 		mButtons.push_back(button);
 	}
 	else 
@@ -228,7 +238,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)
 			rank--;
 		}
 		// ...then insert
-		mButtonCommands.insert(it_command,commandId);
+		mButtonCommands.insert(it_command,temp_command);
 		mButtons.insert(it_button,button);
 	}
 
@@ -241,14 +251,20 @@ bool LLToolBar::removeCommand(const LLCommandId& commandId)
 {
 	if (!hasCommand(commandId)) return false;
 	
+	llinfos << "Merov debug : removeCommand, " << commandId.name() << ", " << commandId.uuid() << llendl;
 	// First erase the map record
-	command_id_map::iterator it = mButtonMap.find(commandId);
+	LLCommandId temp_command = commandId;
+	if (commandId.name() == "Drag Tool")
+	{
+		temp_command = LLCommandId("Drag Tool");
+	}
+	command_id_map::iterator it = mButtonMap.find(temp_command.uuid());
 	mButtonMap.erase(it);
 	
 	// Now iterate on the commands and buttons to identify the relevant records
 	std::list<LLToolBarButton*>::iterator it_button = mButtons.begin();
 	command_id_list_t::iterator it_command = mButtonCommands.begin();
-	while (*it_command != commandId)
+	while (*it_command != temp_command)
 	{
 		++it_button;
 		++it_command;
@@ -276,7 +292,12 @@ bool LLToolBar::hasCommand(const LLCommandId& commandId) const
 {
 	if (commandId != LLCommandId::null)
 	{
-		command_id_map::const_iterator it = mButtonMap.find(commandId);
+		LLCommandId temp_command = commandId;
+		if (commandId.name() == "Drag Tool")
+		{
+			temp_command = LLCommandId("Drag Tool");
+		}
+		command_id_map::const_iterator it = mButtonMap.find(temp_command.uuid());
 		return (it != mButtonMap.end());
 	}
 
@@ -289,7 +310,12 @@ bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled)
 	
 	if (commandId != LLCommandId::null)
 	{
-		command_id_map::iterator it = mButtonMap.find(commandId);
+		LLCommandId temp_command = commandId;
+		if (commandId.name() == "Drag Tool")
+		{
+			temp_command = LLCommandId("Drag Tool");
+		}
+		command_id_map::iterator it = mButtonMap.find(temp_command.uuid());
 		if (it != mButtonMap.end())
 		{
 			it->second->setEnabled(enabled);
@@ -507,7 +533,7 @@ void LLToolBar::updateLayoutAsNeeded()
 			button_rect.setLeftTopAndSize(cur_row, panel_rect.mTop - cur_start, button_clamped_width, button->getRect().getHeight());
 		}
 		button->setShape(button_rect);
-
+		
 		buttons_in_row.push_back(button);
 
 		row_running_length += button_length + mPadBetween;
@@ -592,6 +618,12 @@ void LLToolBar::draw()
 			}
 		}
 	}
+	// HACK!!!
+	if (!mDragAndDropTarget)
+	{
+		removeCommand(mDraggedCommand);
+		mDraggedCommand = LLCommandId::null;
+	}
 
 	updateLayoutAsNeeded();
 	// rect may have shifted during layout
@@ -622,7 +654,12 @@ void LLToolBar::createButtons()
 		LLToolBarButton* button = createButton(command_id);
 		mButtons.push_back(button);
 		mButtonPanel->addChild(button);
-		mButtonMap.insert(std::make_pair(command_id, button));
+		LLCommandId temp_command = command_id;
+		if (command_id.name() == "Drag Tool")
+		{
+			temp_command = LLCommandId("Drag Tool");
+		}
+		mButtonMap.insert(std::make_pair(temp_command.uuid(), button));
 	}
 	mNeedsLayout = true;
 }
@@ -713,7 +750,31 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 	*accept = (handled ? ACCEPT_YES_SINGLE : ACCEPT_NO);
 	
 	// We'll use that flag to change the visual aspect of the toolbar target on draw()
-	mDragAndDropTarget = handled;
+	mDragAndDropTarget = false;
+	
+	// HACK!!!
+	if (!isReadOnly() && handled)
+	{
+		if (!drop)
+		{
+			LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
+			LLAssetType::EType type = inv_item->getType();
+			if (type == LLAssetType::AT_WIDGET)
+			{
+				mRank = getRankFromPosition(x, y);
+				mDraggedCommand = LLCommandId("Drag Tool",inv_item->getUUID());
+				removeCommand(mDraggedCommand);
+				addCommand(mDraggedCommand,mRank);
+				mDragAndDropTarget = true;
+			}
+		}
+		else 
+		{
+			removeCommand(mDraggedCommand);
+			mDraggedCommand = LLCommandId::null;
+		}
+
+	}
 	
 	return handled;
 }
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index be0589f3c673c605164905b5c28bb6f463893b31..9e48dee608eefdc6dd0d612a7ae03088176c8bfe 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -184,6 +184,8 @@ class LLToolBar
 	tool_handledrag_callback_t		mHandleDragItemCallback;
 	tool_handledrop_callback_t		mHandleDropCallback;
 	bool							mDragAndDropTarget;
+	int								mRank;
+	LLCommandId						mDraggedCommand;
 
 public:
 	// Methods used in loading and saving toolbar settings
@@ -205,7 +207,7 @@ class LLToolBar
 	typedef std::list<LLToolBarButton*> toolbar_button_list;
 	toolbar_button_list				mButtons;
 	command_id_list_t				mButtonCommands;
-	typedef std::map<LLCommandId, LLToolBarButton*> command_id_map;
+	typedef std::map<LLUUID, LLToolBarButton*> command_id_map;
 	command_id_map					mButtonMap;
 
 	LLToolBarEnums::ButtonType		mButtonType;
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 8c7dc53af08eb1da1bc4a7fc3affe2fa9cfcc103..44b244f16368c69f18729b8bf566fcca0a3e4d8f 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -375,7 +375,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
 		//llinfos << "Merov debug : handleDropTool. Drop source is a widget -> drop it in place..." << llendl;
 		// Get the command from its uuid
 		LLCommandManager& mgr = LLCommandManager::instance();
-		LLCommandId command_id(inv_item->getUUID());
+		LLCommandId command_id("",inv_item->getUUID());
 		LLCommand* command = mgr.getCommand(command_id);
 		if (command)
 		{
@@ -387,9 +387,10 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
 			}
 			// Suppress the command from the toolbars (including the one it's dropped in, 
 			// this will handle move position).
-			gToolBarView->mToolbarLeft->removeCommand(command->id());
-			gToolBarView->mToolbarRight->removeCommand(command->id());
-			gToolBarView->mToolbarBottom->removeCommand(command->id());
+			llinfos << "Merov debug : handleDropTool, " << command_id.name() << ", " << command_id.uuid() << llendl;
+			gToolBarView->mToolbarLeft->removeCommand(command_id);
+			gToolBarView->mToolbarRight->removeCommand(command_id);
+			gToolBarView->mToolbarBottom->removeCommand(command_id);
 			// Now insert it in the toolbar at the detected rank
 			if (!toolbar->isReadOnly())
 			{