Bug 428170 - TabFolder scroll arrows shown when not needed

Consider initial-gap when calculating size of TabFolder on GTK 3.2+. 
Difference is easily noticable with ControlExample no longer displaying
scrolling arrows by default as the size is properly calculated.

Change-Id: If5ae8a4f5a6410eebee827a140a8d03fd060c6cf
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 6ee0859..9e77c1b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -615,6 +615,7 @@
 	public static final byte[] inconsistent = ascii("inconsistent");
 	public static final byte[] indicator_size = ascii("indicator-size");
 	public static final byte[] indicator_spacing = ascii("indicator-spacing");
+	public static final byte[] initial_gap = ascii("initial-gap");
 	public static final byte[] interior_focus = ascii("interior-focus");
 	public static final byte[] mode = ascii("mode");
 	public static final byte[] model = ascii("model");
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 00740b9..864cca1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -161,6 +161,11 @@
 	OS.gtk_notebook_set_scrollable (handle, false);
 	Point notebookSize = computeNativeSize (handle, wHint, hHint, changed);
 	OS.gtk_notebook_set_scrollable (handle, scrollable);
+	if (OS.GTK_VERSION >= OS.VERSION (3, 2, 0)) {
+		int[] initialGap = new int[1];
+		OS.gtk_widget_style_get (handle, OS.initial_gap, initialGap, 0);
+		notebookSize.x += initialGap[0]*2;
+	}
 	size.x = Math.max (notebookSize.x, size.x);
 	size.y = Math.max (notebookSize.y, size.y);
 	return size;
@@ -198,8 +203,8 @@
 	handle = OS.gtk_notebook_new ();
 	if (handle == 0) error (SWT.ERROR_NO_HANDLES);
 	OS.gtk_container_add (fixedHandle, handle);
-	OS.gtk_notebook_set_scrollable (handle, true);
 	OS.gtk_notebook_set_show_tabs (handle, true);
+	OS.gtk_notebook_set_scrollable (handle, true);
 	if ((style & SWT.BOTTOM) != 0) {
 		OS.gtk_notebook_set_tab_pos (handle, OS.GTK_POS_BOTTOM);
 	}