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>
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 2c7fc9f..1bae8b8 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 @@
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 @@
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);