Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2018-12-13 21:58:15 +0000
committerGenevieve Bastien2018-12-21 02:43:49 +0000
commit8faaaded4e5d029bb7342cd92cca4c37ac76ce9c (patch)
tree3b26b47480d391ead5c5c71fe48ec14b6bbebc19
parent6cdff45e3ea3494ef4b72bbf1536de5c7b6ab661 (diff)
downloadorg.eclipse.tracecompass-8faaaded4e5d029bb7342cd92cca4c37ac76ce9c.tar.gz
org.eclipse.tracecompass-8faaaded4e5d029bb7342cd92cca4c37ac76ce9c.tar.xz
org.eclipse.tracecompass-8faaaded4e5d029bb7342cd92cca4c37ac76ce9c.zip
ui: bug 542724 Fix event table search in gtk
GTK initialization needs to hide the widget and bring the focus back, which caused the event table to loose focus and delete the widget. Now there is a boolean variable to verify before deleting the widget. Change-Id: I7ff910ee56e9eb4426ec9ebad63dfbfaf4f0ef6b Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/134021 Tested-by: CI Bot Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com> (cherry picked from commit 21dc41faa695557a50d8b8511f0d778f5a99028d) Reviewed-on: https://git.eclipse.org/r/134352 Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
index 4268e24995..85f51c8dee 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
@@ -1901,6 +1901,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
newEditor.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(final FocusEvent e) {
+ // With GTK, focus gets lost during initialization, ignore
+ if (!(boolean) newEditor.getData()) {
+ return;
+ }
final boolean changed = updateHeader(newEditor.getText());
if (changed) {
applyHeader();
@@ -1928,8 +1932,16 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
}
});
newEditor.selectAll();
- newEditor.setFocus();
+ /*
+ * Put in the editor's data whether or not the editor has
+ * been set to the table. This is to prevent a bug with gtk
+ * initialization where focus is lost and the widget was
+ * disposed
+ */
+ newEditor.setData(false);
tableEditor.setEditor(newEditor, item, columnIndex);
+ newEditor.setData(true);
+ newEditor.setFocus();
}
}
@@ -2965,7 +2977,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
column.setResizable(resizable[i]);
if (column.getResizable() && width[i] > 0) {
column.setWidth(width[i]);
- } else if (width[i] == 0){
+ } else if (width[i] == 0) {
column.setWidth(0);
}
}

Back to the top