Bug 465280: [GTK3] OS.gtk_widget_get_allocation returns (0,0) for
invisible controls

(BACKPORT TO R4_7)

Fix for issue.
The bugfix was originally started in: 408505 by Anatoly Spektor 
but it looks like there was a handle/tophandle typo made.
Fixing the typo resolves the reported problem.

This also fixes:
497705 – Unhandled event loop > StackOverflow in Perspective
I.e, with this patch, Eclipse on Gtk3 is usable on Ubuntu (yay).

I wrote a few mini-junits. You can validate this patch as following:
- Try running:
Bug497705_setBoundsAfterSetVisible.java
From: https://git.eclipse.org/r/#/c/99981/  (already merged).
- Tests will fail.
- Checkout this patch, run tests again. They pass.

Further, snippet attached to this bug now works as intended.
Child Eclipse behaves fine. Javadoc hover etc... work.

All SWT jUint tests pass.

Change-Id: I11141bf4455e9381b5b26f93940dde1910d909d8
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=465280
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 08e88ee..abe81d4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -1092,12 +1092,13 @@
 		/*
 		 * The widget needs to be shown before its size is allocated
 		 * in GTK 3.8 otherwise its allocation return 0
+                 * See org.eclipse.swt.tests.gtk.snippets.Bug497705_setBoundsAfterSetVisible
 		 */
-		if (OS.GTK_VERSION >= OS.VERSION (3, 8, 0) && !OS.gtk_widget_get_visible(handle))  {
-			OS.gtk_widget_show(handle);
+		if (OS.GTK_VERSION >= OS.VERSION (3, 8, 0) && !OS.gtk_widget_get_visible(topHandle))  {
+			OS.gtk_widget_show(topHandle);
 			gtk_widget_get_preferred_size (topHandle, requisition);
 			OS.gtk_widget_size_allocate (topHandle, allocation);
-			OS.gtk_widget_hide(handle);
+			OS.gtk_widget_hide(topHandle);
 		} else {
 			OS.gtk_widget_size_allocate (topHandle, allocation);
 		}