summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2013-06-28 15:55:13 (EDT)
committer Paul Webster2013-06-28 16:05:40 (EDT)
commit843b81feee9eb9e6ee65a5fe41b20d33a52e6da5 (patch)
tree69f4a8e4fa36db0de8b44ee3433e39ffba8d4f56
parent664586f53615478997b7d98a7a6b8c3198c15e4f (diff)
downloadeclipse.platform.ua-843b81feee9eb9e6ee65a5fe41b20d33a52e6da5.zip
eclipse.platform.ua-843b81feee9eb9e6ee65a5fe41b20d33a52e6da5.tar.gz
eclipse.platform.ua-843b81feee9eb9e6ee65a5fe41b20d33a52e6da5.tar.bz2
Bug 409701 - [Browser] Eclipse help crashes when forced to use XULRunnerM20130703-0800
or WebKit
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java8
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java6
2 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
index 7c00492..6355768 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
@@ -23,6 +23,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
private EmbeddedBrowser browser;
// Thread to use in workbench mode on Windows
private UIThread2 secondThread;
+ private String browserType;
class UIThread2 extends Thread {
Display d;
@@ -60,12 +61,15 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
/**
* Adapter constructor.
*/
- public EmbeddedBrowserAdapter() {
+ public EmbeddedBrowserAdapter(String browserType) {
+ this.browserType = browserType;
}
public Display getBrowserDisplay() {
+ /* only attempt to use a second thread if the Browser's native renderer is IE */
boolean useUIThread2 = BaseHelpSystem.getMode() == BaseHelpSystem.MODE_WORKBENCH
&& Constants.OS_WIN32.equalsIgnoreCase(Platform.getOS())
- && !Constants.WS_WPF.equalsIgnoreCase(SWT.getPlatform()) ;
+ && !Constants.WS_WPF.equalsIgnoreCase(SWT.getPlatform())
+ && "ie".equalsIgnoreCase(browserType); //$NON-NLS-1$
if (useUIThread2) {
if (secondThread == null) {
secondThread = new UIThread2();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
index e604caa..dec7f54 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
@@ -25,6 +25,7 @@ public class EmbeddedBrowserFactory implements IBrowserFactory {
private boolean tested = false;
private boolean available = false;
+ private String browserType;
/**
* Constructor.
@@ -70,7 +71,8 @@ public class EmbeddedBrowserFactory implements IBrowserFactory {
tested = true;
Shell sh = new Shell();
try {
- new Browser(sh, SWT.NONE);
+ Browser browser = new Browser(sh, SWT.NONE);
+ browserType = browser.getBrowserType();
available = true;
} catch (SWTError se) {
if (se.code == SWT.ERROR_NO_HANDLES) {
@@ -94,6 +96,6 @@ public class EmbeddedBrowserFactory implements IBrowserFactory {
* @see IBrowserFactory#createBrowser()
*/
public IBrowser createBrowser() {
- return new EmbeddedBrowserAdapter();
+ return new EmbeddedBrowserAdapter(browserType);
}
}