Community
Participate
Working Groups
- run the ControlExample, go to the List tab - listen for Selection and Default Selection - double click an item in the example List on the page -> on gtk you'll get Selection - Selection - Default Selection -> on all other platforms you'll get Selection - Default Selection
Probably true in Tree and Table as well. I tried to work around this once. GTK is actually issuing two events. The only way to fix this is to remember that a selection happened in mouse down and issue the selection in mouse up but only if a default selection has not happened. Since this would be changing GTK platform behavior, I didn't attempt it. Need to verify that GTK is in fact doing this and it's not an obvious bug in SWT.
I think GTK is doing it (there is no obvious bug in SWT in this part). Changing the selection to happen on mouse up instead of using gtk_changed is gonna cause trouble: the selection can be changed by keyboard input. The problem is that GtkTreeView is using mouse down to implement the gtk_changed, so a double click consist: - mouse click -> selection - mouse click -> selection - mouse double click -> default selection. we can try to detect we are in the second mouse click with " if ((event->button.time < (display->button_click_time[0] + display->double_click_time)) && (event->button.window == display->button_window[0]) && (event->button.button == display->button_number[0]) && (ABS (event->button.x - display->button_x[0]) <= display->double_click_distance) && (ABS (event->button.y - display->button_y[0]) <= display->double_click_distance))" It means you must remember the time, the window, the button, and the x,y position for every button down in the toolkit.
Some other possible solution is to use gtk_change when the event type is keyboard and use mouse up to implement our own selection (as steve suggested). I think it is too hacky. Any other ideas ?
Grant to prioirtize.
I can't reproduce this bug, please re-open if the issue persists.