Bug 401627, better way of handling click to close menu so that it doesn't reopen the menu again, r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@240313 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
enndeakin%sympatico.ca
2007-12-03 16:33:45 +00:00
parent 4f5fd2178a
commit 4909ea089c
24 changed files with 133 additions and 69 deletions

View File

@@ -46,6 +46,7 @@
#include "nsIScreenManager.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsISimpleEnumerator.h"
#include "nsIContent.h"
#ifdef DEBUG
#include "nsIServiceManager.h"
@@ -62,10 +63,27 @@ static PRBool debug_InSecureKeyboardInputMode = PR_FALSE;
static PRInt32 gNumWidgets;
#endif
nsIContent* nsBaseWidget::mLastRollup = nsnull;
// nsBaseWidget
NS_IMPL_ISUPPORTS1(nsBaseWidget, nsIWidget)
nsAutoRollup::nsAutoRollup()
{
// remember if mLastRollup was null, and only clear it upon destruction
// if so. This prevents recursive usage of nsAutoRollup from clearing
// mLastRollup when it shouldn't.
wasClear = !nsBaseWidget::mLastRollup;
}
nsAutoRollup::~nsAutoRollup()
{
if (nsBaseWidget::mLastRollup && wasClear) {
NS_RELEASE(nsBaseWidget::mLastRollup);
}
}
//-------------------------------------------------------------------------
//
// nsBaseWidget constructor