Commits

Vadim Savchuk committed c1c078b

MAINT-117 FIXED Login screen didn't hide if you minimized viewer window right after pressing "Log In".

Comments (0)

Files changed (2)

indra/newview/llprogressview.cpp

 
 #include "llagent.h"
 #include "llbutton.h"
+#include "llcallbacklist.h"
 #include "llfocusmgr.h"
 #include "llnotifications.h"
 #include "llprogressbar.h"
 	mStartupComplete(false)
 {
 	mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1));
+	mFadeToWorldTimer.stop();
+	mFadeFromLoginTimer.stop();
 }
 
 BOOL LLProgressView::postBuild()
 
 	mCancelBtn = getChild<LLButton>("cancel_btn");
 	mCancelBtn->setClickedCallback(  LLProgressView::onCancelButtonClicked, NULL );
-	mFadeToWorldTimer.stop();
-	mFadeFromLoginTimer.stop();
 
 	getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle()));
 
 
 LLProgressView::~LLProgressView()
 {
+	// Just in case something went wrong, make sure we deregister our idle callback.
+	gIdleCallbacks.deleteFunction(onIdle, this);
+
 	gFocusMgr.releaseFocusIfNeeded( this );
 
 	sInstance = NULL;
 	}
 
 	mFadeFromLoginTimer.start();
+	gIdleCallbacks.addFunction(onIdle, this);
 }
 
 void LLProgressView::setStartupComplete()
 		}
 		
 		LLPanel::draw();
-
-		if (mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME )
-		{
-			mFadeFromLoginTimer.stop();
-			LLPanelLogin::closePanel();
-		}
-
 		return;
 	}
 
 		}
 	}
 }
+
+
+// static
+void LLProgressView::onIdle(void* user_data)
+{
+	LLProgressView* self = (LLProgressView*) user_data;
+
+	// Close login panel on mFadeToWorldTimer expiration.
+	if (self->mFadeFromLoginTimer.getStarted() &&
+		self->mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME)
+	{
+		self->mFadeFromLoginTimer.stop();
+		LLPanelLogin::closePanel();
+
+		// Nothing to do anymore.
+		gIdleCallbacks.deleteFunction(onIdle, user_data);
+	}
+}

indra/newview/llprogressview.h

 	public LLViewerMediaObserver
 
 {
+	LOG_CLASS(LLProgressView);
+
 public:
 	LLProgressView();
 	virtual ~LLProgressView();
 	static void onClickMessage(void*);
 	bool onAlertModal(const LLSD& sd);
 
-	// note - this is not just hiding the intro panel - it also hides the parent panel
-	// and is used when the intro is finished and we want to show the world
-	void removeIntroPanel();
-
 protected:
 	LLProgressBar* mProgressBar;
 	LLMediaCtrl* mMediaCtrl;
 	LLEventStream mUpdateEvents; 
 
 	bool handleUpdate(const LLSD& event_data);
+	static void onIdle(void* user_data);
 };
 
 #endif // LL_LLPROGRESSVIEW_H