Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2019-07-17 15:22:26 +0000
committerEric Williams2019-07-17 16:07:16 +0000
commit683d01a40d6ac17c596b7d2017f940efce8135cd (patch)
tree4a6096cfdbd173248e5992937c65e0b8f990b318
parent931a80f6e52b0643fc30c0841590662846bffc26 (diff)
downloadeclipse.platform.swt-683d01a40d6ac17c596b7d2017f940efce8135cd.tar.gz
eclipse.platform.swt-683d01a40d6ac17c596b7d2017f940efce8135cd.tar.xz
eclipse.platform.swt-683d01a40d6ac17c596b7d2017f940efce8135cd.zip
Bug 547933: [GTK] Browser widget not sized properly
Allocate a size to the SwtFixed parent of the WebKit WebView upon the first successful load. Change-Id: Ied3674ed1f7d783d30a189f038a5e04b3e487720 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java8
1 files changed, 8 insertions, 0 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 2c7fc9fd1f..1bae8b8d95 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
@@ -148,6 +148,8 @@ class WebKit extends WebBrowser {
URI tlsErrorUri;
String tlsErrorType;
+ boolean firstLoad = true; //WebKit2 only
+
/**
* Timeout used for javascript execution / deadlock detection.
* Loosely based on the 10s limit commonly found in browsers.
@@ -3384,6 +3386,12 @@ long webkit_load_changed (long web_view, int status, long user_data) {
return handleLoadCommitted (uri, true);
}
case WebKitGTK.WEBKIT2_LOAD_FINISHED: {
+ if (firstLoad) {
+ GtkAllocation allocation = new GtkAllocation ();
+ GTK.gtk_widget_get_allocation(browser.handle, allocation);
+ GTK.gtk_widget_size_allocate(browser.handle, allocation);
+ firstLoad = false;
+ }
addEventHandlers (web_view, true);
long title = WebKitGTK.webkit_web_view_get_title (webView);

Back to the top