diff options
author | Alexander Kurtakov | 2018-08-22 15:21:52 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-08-22 15:21:52 +0000 |
commit | c6e37ef2ef76ca1acb81b99cc5b292749901055b (patch) | |
tree | d64b7220cbd10302c70438567f1a6c1ecebc1f85 | |
parent | 570eea028ff9794f1df7de6a4445780010e8eaa8 (diff) | |
download | eclipse.platform.swt-c6e37ef2ef76ca1acb81b99cc5b292749901055b.tar.gz eclipse.platform.swt-c6e37ef2ef76ca1acb81b99cc5b292749901055b.tar.xz eclipse.platform.swt-c6e37ef2ef76ca1acb81b99cc5b292749901055b.zip |
Revert "Bug 518414 - [gtk] Package explorer double click opens currently selected (highlighted) resource"Y20180822-2200I20180822-2000
This reverts commit 570eea028ff9794f1df7de6a4445780010e8eaa8.
Change-Id: I33051d4de5cd6fc2e785137bb05d25054d30f7fb
4 files changed, 25 insertions, 74 deletions
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 86da9b8b8e..595ea124dd 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 @@ public class List extends Scrollable { 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 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) { } } - /* - * 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 @@ void keyPressDefaultSelectionHandler (long /*int*/ event, int key) { } } -/** - * 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 8c9a3920b8..5db25e2a0a 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 @@ public class Table extends Composite { 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 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) { } } - /* - * 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 @@ void keyPressDefaultSelectionHandler (long /*int*/ event, int key) { } } -/** - * 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 1963655daf..2189f7b081 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 @@ public class Tree extends Composite { 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 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) { } } - /* - * 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 @@ void keyPressDefaultSelectionHandler (long /*int*/ event, int key) { } } -/** - * 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 11946f58c6..d2b568f675 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_realize (long /*int*/ widget) { 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) { |