From 215b95eb64ebea58d6f2bda5f90e307836aca093 Mon Sep 17 00:00:00 2001
From: Alexei Arabadji <aarabadji@productengine.com>
Date: Wed, 18 Nov 2009 11:35:11 +0200
Subject: [PATCH] related to EXT-2515 "Docked floaters should be resizeable"
 avoid undock floater when resize initiated not by user

--HG--
branch : product-engine
---
 indra/llui/lldockablefloater.cpp | 10 ----------
 indra/llui/lldockablefloater.h   |  1 -
 indra/llui/llresizehandle.cpp    |  6 ++++++
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 9a2f2ab4d31..9c69e4f2b66 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -206,16 +206,6 @@ void LLDockableFloater::draw()
 	LLFloater::draw();
 }
 
-void LLDockableFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
-{
-	if (isDocked())
-	{
-		setDocked(false);
-	}
-
-	LLFloater::reshape(width, height, called_from_parent);
-}
-
 void LLDockableFloater::setDockControl(LLDockControl* dockControl)
 {
 	mDockControl.reset(dockControl);
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index e5f94dca91e..46491d8a29e 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -65,7 +65,6 @@ class LLDockableFloater : public LLFloater
 	/* virtula */BOOL postBuild();
 	/* virtual */void setDocked(bool docked, bool pop_on_undock = true);
 	/* virtual */void draw();
-	/* virtual */void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
 
 	/**
 	 *  If descendant class overrides setVisible() then it must still invoke its
diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp
index 7449c339a0d..6239a8f7214 100644
--- a/indra/llui/llresizehandle.cpp
+++ b/indra/llui/llresizehandle.cpp
@@ -135,6 +135,12 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
 		LLView* resizing_view = getParent();
 		if( resizing_view )
 		{
+			// undock floater when user resize it
+			if (((LLFloater*)getParent())->isDocked())
+			{
+				((LLFloater*)getParent())->setDocked(false, false);
+			}
+
 			// Resize the parent
 			LLRect orig_rect = resizing_view->getRect();
 			LLRect scaled_rect = orig_rect;
-- 
GitLab