summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <grant_gayed@ca.ibm.com>2012-07-16 14:59:19 -0400
committerGrant Gayed <grant_gayed@ca.ibm.com>2012-07-16 14:59:19 -0400
commitf9a08dbd6beda8d1b619e1c7b08fd9da6fe993bb (patch)
tree2c66b90a4c145adf553eb7993e5df11d7043916b
parentc9f7838af1e54e39107b4e5302048b7cebef9023 (diff)
downloadeclipse.platform.swt-f9a08dbd6beda8d1b619e1c7b08fd9da6fe993bb.tar.gz
eclipse.platform.swt-f9a08dbd6beda8d1b619e1c7b08fd9da6fe993bb.tar.xz
eclipse.platform.swt-f9a08dbd6beda8d1b619e1c7b08fd9da6fe993bb.zip
Bug 381006 - browser can not get focus when current focus is on some SWT
control
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
index aeb79b3dcf..b51c6450a7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
@@ -177,6 +177,8 @@ void handleFocus () {
}
void handleMouseDown () {
+ Mozilla mozilla = (Mozilla)browser.webBrowser;
+ if (!mozilla.isActive) mozilla.Activate ();
}
boolean hookEnterExit () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
index 2218d1bfda..07aed67ee9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
@@ -48,7 +48,7 @@ class Mozilla extends WebBrowser {
int refCount, lastKeyCode, lastCharCode, authCount;
int /*long*/ request, badCertRequest;
Point location, size;
- boolean visible, isChild, ignoreDispose, isRetrievingBadCert, isViewingErrorPage, ignoreAllMessages, untrustedText;
+ boolean visible, isActive, isChild, ignoreDispose, isRetrievingBadCert, isViewingErrorPage, ignoreAllMessages, untrustedText;
boolean updateLastNavigateUrl;
Shell tip = null;
Listener listener;
@@ -2716,6 +2716,7 @@ void onDispose (Display display) {
}
void Activate () {
+ isActive = true;
int /*long*/[] result = new int /*long*/[1];
int rc = webBrowser.QueryInterface (nsIWebBrowserFocus.NS_IWEBBROWSERFOCUS_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
@@ -2728,6 +2729,7 @@ void Activate () {
}
void Deactivate () {
+ isActive = false;
int /*long*/[] result = new int /*long*/[1];
int rc = webBrowser.QueryInterface (nsIWebBrowserFocus.NS_IWEBBROWSERFOCUS_IID, result);
if (rc != XPCOM.NS_OK) error (rc);