From 55aa33ae20ba85fd9947dbe097989802e1467b82 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 14 Mar 2014 09:59:11 +0100 Subject: [PATCH] FIRE-13129: Ctrl + Shift + W will not close communications floater if an IM tab is open --- indra/llui/llfloater.cpp | 8 ++++++++ indra/llui/llmultifloater.cpp | 32 +++----------------------------- indra/llui/llmultifloater.h | 5 +---- 3 files changed, 12 insertions(+), 33 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c0b411e943..32b8e72d82 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1874,6 +1874,14 @@ void LLFloater::initRectControl() void LLFloater::closeFrontmostFloater() { LLFloater* floater_to_close = gFloaterView->getFrontmostClosableFloater(); + // CTRL-W doesn't work with multifloaters + LLMultiFloater* multi_floater = dynamic_cast(floater_to_close); + if (multi_floater) + { + multi_floater->closeDockedFloater(); + } + else + // if(floater_to_close) { floater_to_close->closeFloater(); diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 83d27cf445..c79735b253 100755 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -579,14 +579,8 @@ void LLMultiFloater::computeResizeLimits(S32& new_min_width, S32& new_min_height } // CTRL-W doesn't work with multifloaters -void LLMultiFloater::closeFloater(bool app_quitting) +void LLMultiFloater::closeDockedFloater() { - if (app_quitting) - { - LLFloater::closeFloater(app_quitting); - return; - } - LLFloater* floater = getActiveFloater(); // is user closeable and is system closeable if (floater && floater->canClose() && floater->isCloseable()) @@ -602,33 +596,13 @@ void LLMultiFloater::closeFloater(bool app_quitting) else { // Call closeFloater() here so that focus gets properly handed over - LLFloater::closeFloater(); + closeFloater(); } return; } // Close multifloater itself if we can't close any hosted floaters - LLFloater::closeFloater(); -} - -void LLMultiFloater::onClickCloseBtn(bool app_quitting) -{ - LLFloater::closeFloater(false); -} - -// Ansa: Will be called when toggling view - in that case we want to -// toggle the whole floater instead of the active hosted floater -void LLMultiFloater::closeHostedFloater() -{ - // When toggling *visibility*, close the host instead of the floater when hosted - if (getHost()) - { - getHost()->closeFloater(); - } - else - { - LLFloater::closeFloater(false); - } + closeFloater(); } // diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index f7d59a53cf..fa834ddd01 100755 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -80,10 +80,7 @@ public: virtual void updateFloaterTitle(LLFloater* floaterp); // CTRL-W doesn't work with multifloaters - /*virtual*/ void closeFloater(bool app_quitting = false); - /*virtual*/ void onClickCloseBtn(bool app_quitting = false); - /*virtual*/ void closeHostedFloater(); - // + void closeDockedFloater(); protected: struct LLFloaterData