After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662979 - Race condition when right-clicking after selecting files
Race condition when right-clicking after selecting files
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-10-29 01:39 UTC by Jean-François Fortin Tam
Modified: 2011-12-17 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screencast (708.77 KB, video/webm)
2011-10-29 03:44 UTC, Jean-François Fortin Tam
  Details
Lower the rubberbanding rectangle so canvas item can pick the click (1.03 KB, patch)
2011-12-14 13:18 UTC, Nelson Benitez
committed Details | Review

Description Jean-François Fortin Tam 2011-10-29 01:39:49 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.
Comment 1 Jean-François Fortin Tam 2011-10-29 03:44:01 UTC
Created attachment 200236 [details]
screencast
Comment 2 Nelson Benitez 2011-12-14 13:18:26 UTC
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.
Comment 3 Cosimo Cecchi 2011-12-14 13:29:20 UTC
Review of attachment 203459 [details] [review]:

Thanks, looks and works fine.
Comment 4 Nelson Benitez 2011-12-17 11:26:37 UTC
Comment on attachment 203459 [details] [review]
Lower the rubberbanding rectangle so canvas item can pick the click

Committed. Marking as Fixed.