diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-05-28 15:04:02 -0400 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-05-28 15:04:02 -0400 |
commit | 2cbee717c205414c34c64d48f8883400973c429e (patch) | |
tree | 11e63410989bc2dc00aafbd4e735527cf189863f | |
parent | 87e495a733f3e347f3ee0b41af959148dc9e3583 (diff) | |
download | eclipse.platform.swt-2cbee717c205414c34c64d48f8883400973c429e.tar.gz eclipse.platform.swt-2cbee717c205414c34c64d48f8883400973c429e.tar.xz eclipse.platform.swt-2cbee717c205414c34c64d48f8883400973c429e.zip |
Bug 392967 - eclipse crash SIGSEGV when trying to use Webkit
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java index 6a9dd53740..a90b730751 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java +++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java @@ -650,18 +650,20 @@ public void create (Composite parent, int style) { browser.setData (KEY_CHECK_SUBWINDOW, Boolean.FALSE); /* - * Bug in WebKitGTK. In WebKitGTK releases >= 1.10 a crash can occur if an - * attempt is made to show a browser before a size has been set on it. The - * workaround is to temporarily give it a size in order to force the native - * resize events to fire. + * Bug in WebKitGTK. In WebKitGTK 1.10.x a crash can occur if an + * attempt is made to show a browser before a size has been set on + * it. The workaround is to temporarily give it a size that forces + * the native resize events to fire. */ + int major = WebKitGTK.webkit_major_version (); int minor = WebKitGTK.webkit_minor_version (); - if (minor >= 10) { - Point size = browser.getSize(); - size.x += 2; size.y += 2; - browser.setSize(size); - size.x -= 2; size.y -= 2; - browser.setSize(size); + if (major == 1 && minor >= 10) { + Rectangle minSize = browser.computeTrim (0, 0, 2, 2); + Point size = browser.getSize (); + size.x += minSize.width; size.y += minSize.height; + browser.setSize (size); + size.x -= minSize.width; size.y -= minSize.height; + browser.setSize (size); } } |