GNOME Bugzilla – Bug 662979
Race condition when right-clicking after selecting files
Last modified: 2011-12-17 11:27:01 UTC
I finally managed to track down a very annoying "bohrbug" concerning file selections. I think it first appeared in 3.0 but I'm not 100% sure. The symptom: most of the time, I select multiple files and end up losing the selection when I right-click on them afterwards. How to reproduce: 1- select one (or more file) with the rectangle selection 2- do not move the mouse 3- immediately right-click. Result: the files get deselected. Now, the "racy" part in this is that it will only happen if you go from step 2 to step 3 in less than a second (as I usually do). If you wait a second before right-clicking, the bug does not occur. If you are quick enough, the bug occurs 100% of the time.
Created attachment 200236 [details] screencast
Created attachment 203459 [details] [review] Lower the rubberbanding rectangle so canvas item can pick the click Hi, this regression was caused by the rubberbanding fade-out effect that was implemented ten months ago, the problem is the right-click event gets fired before the rubberbanding rectangle is gone, because now it gets 150ms to do the fade-out effect till disappear while before it was instant. While the rubberbanding rectangle is still there the canvas item that represent the file can't get the click event, to be precise the following function returned false: nautilus_icon_container.c:button_press_event() /* Invoke the canvas event handler and see if an item picks up the event. */ clicked_on_icon = GTK_WIDGET_CLASS (nautilus_icon_container_parent_class)->button_press_event (widget, event); Lowering the z-order of the rectangle seems to fix the issue and the item behind it can now pick the event. Thanks nekohayo for the screencast it helped me understand the issue.
Review of attachment 203459 [details] [review]: Thanks, looks and works fine.
Comment on attachment 203459 [details] [review] Lower the rubberbanding rectangle so canvas item can pick the click Committed. Marking as Fixed.