diff options
| author | Geneviève Bastien | 2018-12-13 21:58:15 +0000 |
|---|---|---|
| committer | Genevieve Bastien | 2018-12-20 14:31:24 +0000 |
| commit | 21dc41faa695557a50d8b8511f0d778f5a99028d (patch) | |
| tree | eb12cb4d105c2fed2fb17a9cff96bf1be794642b | |
| parent | 0bba864ee658df3924561ade78b1be00dc4825de (diff) | |
| download | org.eclipse.tracecompass-21dc41faa695557a50d8b8511f0d778f5a99028d.tar.gz org.eclipse.tracecompass-21dc41faa695557a50d8b8511f0d778f5a99028d.tar.xz org.eclipse.tracecompass-21dc41faa695557a50d8b8511f0d778f5a99028d.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>
| -rw-r--r-- | tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java | 16 |
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); } } |
