From c269e9fc4d8dae7a50c7b8f5692809aa40d6c05c Mon Sep 17 00:00:00 2001 From: "saari%netscape.com" Date: Sat, 26 Feb 2000 00:59:41 +0000 Subject: [PATCH] fix for 28467, a=jar, r=hyatt --- .../document/src/nsXULCommandDispatcher.cpp | 23 ++++++++++++++++++- .../xul/document/src/nsXULCommandDispatcher.h | 2 ++ rdf/content/src/nsXULCommandDispatcher.cpp | 23 ++++++++++++++++++- rdf/content/src/nsXULCommandDispatcher.h | 2 ++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/content/xul/document/src/nsXULCommandDispatcher.cpp b/content/xul/document/src/nsXULCommandDispatcher.cpp index 2a2d6e82acf..6d71e6b94cd 100644 --- a/content/xul/document/src/nsXULCommandDispatcher.cpp +++ b/content/xul/document/src/nsXULCommandDispatcher.cpp @@ -53,7 +53,8 @@ static PRLogModuleInfo* gLog; //////////////////////////////////////////////////////////////////////// nsXULCommandDispatcher::nsXULCommandDispatcher(void) - : mScriptObject(nsnull), mUpdaters(nsnull), mSuppressFocus(PR_FALSE) + : mScriptObject(nsnull), mUpdaters(nsnull), mSuppressFocus(PR_FALSE), + mActive(PR_FALSE), mFocusInitialized(PR_FALSE) { NS_INIT_REFCNT(); @@ -575,3 +576,23 @@ nsXULCommandDispatcher::SetSuppressFocus(PRBool aSuppressFocus) mSuppressFocus = aSuppressFocus; return NS_OK; } + +NS_IMETHODIMP +nsXULCommandDispatcher::GetActive(PRBool* aActive) +{ + //if(!mFocusInitialized) + // return PR_TRUE; + + *aActive = mActive; + return NS_OK; +} + +NS_IMETHODIMP +nsXULCommandDispatcher::SetActive(PRBool aActive) +{ + if(!mFocusInitialized) + mFocusInitialized = PR_TRUE; + + mActive = aActive; + return NS_OK; +} \ No newline at end of file diff --git a/content/xul/document/src/nsXULCommandDispatcher.h b/content/xul/document/src/nsXULCommandDispatcher.h index 06cfa567a9e..c8a347fc689 100644 --- a/content/xul/document/src/nsXULCommandDispatcher.h +++ b/content/xul/document/src/nsXULCommandDispatcher.h @@ -86,6 +86,8 @@ protected: nsCOMPtr mCurrentWindow; // [OWNER] PRBool mSuppressFocus; + PRBool mActive; + PRBool mFocusInitialized; class Updater { public: diff --git a/rdf/content/src/nsXULCommandDispatcher.cpp b/rdf/content/src/nsXULCommandDispatcher.cpp index 2a2d6e82acf..6d71e6b94cd 100644 --- a/rdf/content/src/nsXULCommandDispatcher.cpp +++ b/rdf/content/src/nsXULCommandDispatcher.cpp @@ -53,7 +53,8 @@ static PRLogModuleInfo* gLog; //////////////////////////////////////////////////////////////////////// nsXULCommandDispatcher::nsXULCommandDispatcher(void) - : mScriptObject(nsnull), mUpdaters(nsnull), mSuppressFocus(PR_FALSE) + : mScriptObject(nsnull), mUpdaters(nsnull), mSuppressFocus(PR_FALSE), + mActive(PR_FALSE), mFocusInitialized(PR_FALSE) { NS_INIT_REFCNT(); @@ -575,3 +576,23 @@ nsXULCommandDispatcher::SetSuppressFocus(PRBool aSuppressFocus) mSuppressFocus = aSuppressFocus; return NS_OK; } + +NS_IMETHODIMP +nsXULCommandDispatcher::GetActive(PRBool* aActive) +{ + //if(!mFocusInitialized) + // return PR_TRUE; + + *aActive = mActive; + return NS_OK; +} + +NS_IMETHODIMP +nsXULCommandDispatcher::SetActive(PRBool aActive) +{ + if(!mFocusInitialized) + mFocusInitialized = PR_TRUE; + + mActive = aActive; + return NS_OK; +} \ No newline at end of file diff --git a/rdf/content/src/nsXULCommandDispatcher.h b/rdf/content/src/nsXULCommandDispatcher.h index 06cfa567a9e..c8a347fc689 100644 --- a/rdf/content/src/nsXULCommandDispatcher.h +++ b/rdf/content/src/nsXULCommandDispatcher.h @@ -86,6 +86,8 @@ protected: nsCOMPtr mCurrentWindow; // [OWNER] PRBool mSuppressFocus; + PRBool mActive; + PRBool mFocusInitialized; class Updater { public: