| Summary: | [GTK] EraseItem and PaintItem events are missing SWT.FOCUSED bit | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Grant Gayed <grant_gayed> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ericwill, pinnamur |
| Version: | 3.6 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux-GTK | ||
| Whiteboard: | |||
This bug is still reproducible. Hmm, undoing some of the changes to bug 393724 fixes this. I'll have to test it further though. Oops, I misread the bug report. SWT on GTK3.22 has the proper behaviour -- closing this ticket. |
- tried with gtk+ 2.4 and 2.10, with the latest swt - there are references to SWT.FOCUSED in Table and Tree, so maybe this used to work? - run the snippet below - item focus can be moved with Ctrl+ArrowUp/ArrowDown - the EraseItem and PaintItem events are received but their detail field never contains the SWT.FOCUSED bit public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setBounds(10,10,200,200); shell.setLayout(new FillLayout()); final Tree tree = new Tree(shell, SWT.MULTI); for (int i = 0; i < 9; i++) { new TreeItem(tree, SWT.NONE).setText("item " + i); } tree.addListener(SWT.EraseItem, new Listener() { public void handleEvent(Event event) { System.out.println("EraseItem event"); if ((event.detail & SWT.FOCUSED) != 0) { System.out.println("item has focus: " + ((TreeItem)event.item).getText()); } } }); tree.addListener(SWT.PaintItem, new Listener() { public void handleEvent(Event event) { System.out.println("PaintItem event"); if ((event.detail & SWT.FOCUSED) != 0) { System.out.println("item has focus: " + ((TreeItem)event.item).getText()); } } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }