[PATCH] Clear icon container drag state when removing icon

The attached icon fixes bug 158196 [1] which occurs when you're moving
the mouse but the drag threshold is not yet reached and the icon you're
trying to drag is removed from the container. The attached patch clears
the drag state in that case. Note that this will not break drags that
are already in progress, they fail silently like before - since the
NautilusIconContainer drag information unlike the NautilusIconDnd drag
state just refer to details->drag_icon and details->drag_state, which
are not queried any longer after the "drag-begin" emission.

You can simply verify the crasher by running something like
  while [ 1 ]; do touch bf; sleep 0.5; rm bf; sleep 0.5; done
in a terminal in ~/Desktop. If you start the drag shortly before the
icon removal is propagated, you'll get the reported crash.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=158196

Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-icon-container.c
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.398
diff -u -p -r1.398 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	30 Sep 2005 15:10:28 -0000	1.398
+++ libnautilus-private/nautilus-icon-container.c	30 Sep 2005 18:11:59 -0000
@@ -4790,6 +4790,9 @@ icon_destroy (NautilusIconContainer *con
 	if (details->keyboard_icon_to_reveal == icon) {
 		unschedule_keyboard_icon_reveal (container);
+	if (details->drag_icon == icon) {
+		clear_drag_state (container);
+	}
 	if (details->drop_target == icon) {
 		details->drop_target = NULL;

Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]