Revert "Bug 518414 - [gtk] Package explorer double click opens currently selected (highlighted) resource"

This reverts commit 570eea028ff9794f1df7de6a4445780010e8eaa8.

Change-Id: I33051d4de5cd6fc2e785137bb05d25054d30f7fb
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 86da9b8..595ea12 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -49,7 +49,6 @@
 
 	static final int TEXT_COLUMN = 0;
 	double cachedAdjustment, currentAdjustment;
-	boolean rowActivated;
 
 /**
  * Constructs a new instance of this class given its parent
@@ -908,27 +907,14 @@
 		}
 	}
 
-	/*
-	 * Bug 312568: If mouse double-click pressed, manually send a DefaultSelection.
-	 * Bug 518414: Added rowActivated guard flag to only send a DefaultSelection when the
-	 * double-click triggers a 'row-activated' signal. Note that this relies on the fact
-	 * that 'row-activated' signal comes before double-click event. This prevents
-	 * opening of the current highlighted item when double clicking on any expander arrow.
-	 */
-	if (gdkEvent.type == GDK.GDK_2BUTTON_PRESS && rowActivated) {
+	//If Mouse double-click pressed, manually send a DefaultSelection.  See Bug 312568.
+	if (gdkEvent.type == GDK.GDK_2BUTTON_PRESS) {
 		sendTreeDefaultSelection ();
-		rowActivated = false;
 	}
 
 	return result;
 }
 
-@Override
-long /*int*/ gtk_row_activated (long /*int*/ tree, long /*int*/ path, long /*int*/ column) {
-	rowActivated = true;
-	return 0;
-}
-
 
 @Override
 long /*int*/ gtk_key_press_event (long /*int*/ widget, long /*int*/ event) {
@@ -991,20 +977,19 @@
 	}
 }
 
-/**
- * Used to emulate DefaultSelection event. See Bug 312568.
- * Feature in GTK. 'row-activation' event comes before DoubleClick event.
- * This is causing the editor not to get focus after double-click.
- * The solution is to manually send the DefaultSelection event after a double-click,
- * and to emulate it for Space/Return.
- */
+//Used to emulate DefaultSelection event. See Bug 312568.
+//Feature in GTK. 'row-activation' event comes before DoubleClick event.
+//This is causing the editor not to get focus after doubleclick.
+//The solution is to manually send the DefaultSelection event after a doubleclick,
+//and to emulate it for Space/Return.
 void sendTreeDefaultSelection() {
 
 	//Note, similar DefaultSelectionHandling in SWT List/Table/Tree
 	Event event = new Event ();
 	event.index = this.getFocusIndex ();
 
-	if (event.index >= 0) event.text = this.getItem (event.index);
+	if (event.index >= 0)
+		event.text = this.getItem (event.index);
 	sendSelectionEvent (SWT.DefaultSelection, event, false);
 }
 
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 8c9a392..5db25e2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -94,7 +94,6 @@
 	double cachedAdjustment, currentAdjustment;
 	int pixbufHeight, pixbufWidth;
 	boolean boundsChangedSinceLastDraw;
-	boolean rowActivated;
 
 	static final int CHECKED_COLUMN = 0;
 	static final int GRAYED_COLUMN = 1;
@@ -2141,29 +2140,15 @@
 		}
 	}
 
-	/*
-	 * Bug 312568: If mouse double-click pressed, manually send a DefaultSelection.
-	 * Bug 518414: Added rowActivated guard flag to only send a DefaultSelection when the
-	 * double-click triggers a 'row-activated' signal. Note that this relies on the fact
-	 * that 'row-activated' signal comes before double-click event. This prevents
-	 * opening of the current highlighted item when double clicking on any expander arrow.
-	 */
-	if (gdkEvent.type == GDK.GDK_2BUTTON_PRESS && rowActivated) {
+	//If Mouse double-click pressed, manually send a DefaultSelection.  See Bug 312568.
+	if (gdkEvent.type == GDK.GDK_2BUTTON_PRESS) {
 		sendTreeDefaultSelection ();
-		rowActivated = false;
 	}
 
 	return result;
 }
 
 @Override
-long /*int*/ gtk_row_activated (long /*int*/ tree, long /*int*/ path, long /*int*/ column) {
-	rowActivated = true;
-	return 0;
-}
-
-
-@Override
 long /*int*/ gtk_key_press_event (long /*int*/ widget, long /*int*/ event) {
 	GdkEventKey keyEvent = new GdkEventKey ();
 	OS.memmove (keyEvent, event, GdkEventKey.sizeof);
@@ -2191,13 +2176,11 @@
 	}
 }
 
-/**
- * Used to emulate DefaultSelection event. See Bug 312568.
- * Feature in GTK. 'row-activation' event comes before DoubleClick event.
- * This is causing the editor not to get focus after double-click.
- * The solution is to manually send the DefaultSelection event after a double-click,
- * and to emulate it for Space/Return.
- */
+//Used to emulate DefaultSelection event. See Bug 312568.
+//Feature in GTK. 'row-activation' event comes before DoubleClick event.
+//This is causing the editor not to get focus after doubleclick.
+//The solution is to manually send the DefaultSelection event after a doubleclick,
+//and to emulate it for Space/Return.
 void sendTreeDefaultSelection() {
 
 	//Note, similar DefaultSelectionHandling in SWT List/Table/Tree
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 1963655..2189f7b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -101,7 +101,6 @@
 	Color headerBackground, headerForeground;
 	String headerCSSBackground, headerCSSForeground;
 	boolean boundsChangedSinceLastDraw;
-	boolean rowActivated;
 
 	static final int ID_COLUMN = 0;
 	static final int CHECKED_COLUMN = 1;
@@ -2178,28 +2177,15 @@
 		}
 	}
 
-	/*
-	 * Bug 312568: If mouse double-click pressed, manually send a DefaultSelection.
-	 * Bug 518414: Added rowActivated guard flag to only send a DefaultSelection when the
-	 * double-click triggers a 'row-activated' signal. Note that this relies on the fact
-	 * that 'row-activated' signal comes before double-click event. This prevents
-	 * opening of the current highlighted item when double clicking on any expander arrow.
-	 */
-	if (gdkEvent.type == GDK.GDK_2BUTTON_PRESS && rowActivated) {
+	//If Mouse double-click pressed, manually send a DefaultSelection.  See Bug 312568.
+	if (gdkEvent.type == GDK.GDK_2BUTTON_PRESS) {
 		sendTreeDefaultSelection ();
-		rowActivated = false;
 	}
 
 	return result;
 }
 
 @Override
-long /*int*/ gtk_row_activated (long /*int*/ tree, long /*int*/ path, long /*int*/ column) {
-	rowActivated = true;
-	return 0;
-}
-
-@Override
 long /*int*/ gtk_key_press_event (long /*int*/ widget, long /*int*/ event) {
 	GdkEventKey keyEvent = new GdkEventKey ();
 	OS.memmove (keyEvent, event, GdkEventKey.sizeof);
@@ -2227,13 +2213,11 @@
 	}
 }
 
-/**
- * Used to emulate DefaultSelection event. See Bug 312568.
- * Feature in GTK. 'row-activation' event comes before DoubleClick event.
- * This is causing the editor not to get focus after double-click.
- * The solution is to manually send the DefaultSelection event after a double-click,
- * and to emulate it for Space/Return.
- */
+//Used to emulate DefaultSelection event. See Bug 312568.
+//Feature in GTK. 'row-activation' event comes before DoubleClick event.
+//This is causing the editor not to get focus after doubleclick.
+//The solution is to manually send the DefaultSelection event after a doubleclick,
+//and to emulate it for Space/Return.
 void sendTreeDefaultSelection() {
 
 	//Note, similar DefaultSelectionHandling in SWT List/Table/Tree
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index 11946f5..d2b568f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -864,9 +864,8 @@
 
 long /*int*/ gtk_row_activated (long /*int*/ tree, long /*int*/ path, long /*int*/ column) {
 	return 0;
-	// Note on SWT Tree/Table/List. This signal is no longer used for sending events, instead
-	// Send DefaultSelection is manually emitted. We use this function to know whether a
-	// 'row-activated' is triggered. See Bug 312568, 518414.
+	//Note on SWT Tree/Table/List. This signal is no longer used. Instead SendDefaultSelection is
+	//Manually emitted.  See Bug 312568.
 }
 
 long /*int*/ gtk_row_deleted (long /*int*/ model, long /*int*/ path) {