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.
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) gtk_button_ press_event( int, int, boolean) is a bit convoluted: setActiveContro l (...)" call *sends* an activate event, which is processed immediately.
The execution sequence in Control.
- First, the "sendMouseEvent (..., false, ...)" call *posts* a mouse down event, which is enqueued.
- Then, the "shell.
- 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.