Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2015-06-11 11:23:42 -0400
committerLeo Ufimtsev2015-08-10 16:54:24 -0400
commita3efa8a12b1523368010bc15e96de20d5bb62930 (patch)
treef4798c88db1c70cd00c1a07584c7f3a65c7a1292
parent4fde7cedde999951b9699d8958f188e6cf10d51a (diff)
downloadeclipse.platform.swt-a3efa8a12b1523368010bc15e96de20d5bb62930.tar.gz
eclipse.platform.swt-a3efa8a12b1523368010bc15e96de20d5bb62930.tar.xz
eclipse.platform.swt-a3efa8a12b1523368010bc15e96de20d5bb62930.zip
Bug 312568 (Part 1) - [GTK] Editor does not get focus after double click
from Project/Package Explorer This is part 1 of the fix to prevent package explorer from stealing focus. Here I remove a workaround introduced 11 years ago. See: git show 300ace8e3eaec6136b4861feec65efae8fe149fc Originally not-returning focus caused a seg-fault in GtkTree. But this is no longer the case with current Gtk. TESTS PERFORMED after removal: - 64 bit machine - (SWT Tree+List+Table) * (Gtk2.24 + Gtk3.14) -> No crashes observed. I Used snippet in my Repo for testing: https://github.com/LeoUfimtsev/LeoSwtTests/blob/master/src/standaloneTests/LTEST_465984_TreeDoubleClick.java But any Tree/Table/List snippet will do. Noticible changes in the behaviour of the snippet: - GTK2 : No changes can be observed with/without patch. - GKT3 : Focus now stays in the text field after double-clicking on SWT Tree/List/Table. Part 2 of the fix is on it's way. Change-Id: Ie27503caac60a97459b3cb86dc9e024f2e879cd0 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java9
3 files changed, 0 insertions, 27 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 9a45a901cb..988c899a5f 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
@@ -808,15 +808,6 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) {
}
}
}
- /*
- * Bug in GTK. GTK segments fault, if the GtkTreeView widget is
- * not in focus and all items in the widget are disposed before
- * it finishes processing a button press. The fix is to give
- * focus to the widget before it starts processing the event.
- */
- if (!OS.gtk_widget_has_focus (handle)) {
- OS.gtk_widget_grab_focus (handle);
- }
return result;
}
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 20b2459db8..73b742d9ae 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
@@ -1891,15 +1891,6 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) {
}
}
}
- /*
- * Bug in GTK. GTK segments fault, if the GtkTreeView widget is
- * not in focus and all items in the widget are disposed before
- * it finishes processing a button press. The fix is to give
- * focus to the widget before it starts processing the event.
- */
- if (!OS.gtk_widget_has_focus (handle)) {
- OS.gtk_widget_grab_focus (handle);
- }
return result;
}
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 cef483d5ce..7bd10e7545 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
@@ -1877,15 +1877,6 @@ long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) {
}
}
}
- /*
- * Bug in GTK. GTK segments fault, if the GtkTreeView widget is
- * not in focus and all items in the widget are disposed before
- * it finishes processing a button press. The fix is to give
- * focus to the widget before it starts processing the event.
- */
- if (!OS.gtk_widget_has_focus (handle)) {
- OS.gtk_widget_grab_focus (handle);
- }
return result;
}

Back to the top