Comment 36 for bug 586910

Revision history for this message
In , Markus-keller (markus-keller) wrote :

Here's a standalone snippet. If you double-click the tree item on Windows, the focus ends up in the Text as expected. On GTK, focus goes back to the Tree.

(In reply to comment #30)
The execution sequence in Control.gtk_button_press_event(int, int, boolean) is a bit convoluted:
- First, the "sendMouseEvent (..., false, ...)" call *posts* a mouse down event, which is enqueued.
- Then, the "shell.setActiveControl (...)" call *sends* an activate event, which is processed immediately.
- Later, the enqueued mouse down is processed

=> The final order of the Activate, MouseDown, and DefaultSelection events is correct.

The real problem is somewhere deeper in the SWT/GTK interaction. I first thought it's just the "OS.gtk_widget_grab_focus (handle);" at the end of Tree.gtk_button_press_event(int, int) on line 1891, but when I remove that and run the snippet, I still get some callbacks via windowProc that remove the focus from the Text again.