public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in gnome-base/nautilus/files: nautilus-2.26.4-file-roller-drag-n-drop.patch
@ 2009-12-30  0:11 Nirbheek Chauhan (nirbheek)
  0 siblings, 0 replies; only message in thread
From: Nirbheek Chauhan (nirbheek) @ 2009-12-30  0:11 UTC (permalink / raw
  To: gentoo-commits

nirbheek    09/12/30 00:11:42

  Added:                nautilus-2.26.4-file-roller-drag-n-drop.patch
  Log:
  Fix nautilus window closing when doing DnD from file-roller, bug 290001
  (Portage version: 2.1.7.16/cvs/Linux i686)

Revision  Changes    Path
1.1                  gnome-base/nautilus/files/nautilus-2.26.4-file-roller-drag-n-drop.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.26.4-file-roller-drag-n-drop.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.26.4-file-roller-drag-n-drop.patch?rev=1.1&content-type=text/plain

Index: nautilus-2.26.4-file-roller-drag-n-drop.patch
===================================================================
Fixes nautilus window closing when doing DnD from file-roller.
Patch is taken from upstream git

http://bugs.gentoo.org/show_bug.cgi?id=290001

---
From 23278532505862816bd5c8c0ab7d17f7a07b4790 Mon Sep 17 00:00:00 2001
From: Cosimo Cecchi <cosimoc@gnome.org>
Date: Fri, 09 Oct 2009 17:19:42 +0000
Subject: Always check if the drag dest supports the source.

In the "drag-motion" callback, make sure we check for target != GDK_NONE
before getting non-existent data for it.
---
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c
index b7e1df2..15b6395 100644
--- a/libnautilus-private/nautilus-dnd.c
+++ b/libnautilus-private/nautilus-dnd.c
@@ -1010,7 +1010,7 @@ nautilus_drag_selection_includes_special_link (GList *selection_list)
 	return FALSE;
 }
 
-static void
+static gboolean
 slot_proxy_drag_motion (GtkWidget          *widget,
 			GdkDragContext     *context,
 			int                 x,
@@ -1038,6 +1038,11 @@ slot_proxy_drag_motion (GtkWidget          *widget,
 
 	if (!drag_info->have_data) {
 		target = gtk_drag_dest_find_target (widget, context, NULL);
+
+		if (target == GDK_NONE) {
+			goto out;
+		}
+
 		gtk_drag_get_data (widget, context, target, time);
 	}
 
@@ -1079,6 +1084,8 @@ out:
 	}
 
 	gdk_drag_status (context, action, time);
+
+	return TRUE;
 }
 
 static void
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 1d07bba..9a87322 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -850,7 +850,7 @@ compute_drop_position (GtkTreeView *tree_view,
 }
 
 
-static void
+static gboolean
 get_drag_data (GtkTreeView *tree_view,
 	       GdkDragContext *context, 
 	       unsigned int time)
@@ -861,8 +861,14 @@ get_drag_data (GtkTreeView *tree_view,
 					    context, 
 					    NULL);
 
+	if (target == GDK_NONE) {
+		return FALSE;
+	}
+
 	gtk_drag_get_data (GTK_WIDGET (tree_view),
 			   context, target, time);
+
+	return TRUE;
 }
 
 static void
@@ -928,7 +934,9 @@ drag_motion_callback (GtkTreeView *tree_view,
 	char *uri;
 
 	if (!sidebar->drag_data_received) {
-		get_drag_data (tree_view, context, time);
+		if (!get_drag_data (tree_view, context, time)) {
+			return FALSE;
+		}
 	}
 
 	compute_drop_position (tree_view, x, y, &path, &pos, sidebar);
@@ -1269,10 +1277,11 @@ drag_drop_callback (GtkTreeView *tree_view,
 		    unsigned int time,
 		    NautilusPlacesSidebar *sidebar)
 {
+	gboolean retval = FALSE;
 	sidebar->drop_occured = TRUE;
-	get_drag_data (tree_view, context, time);
+	retval = get_drag_data (tree_view, context, time);
 	g_signal_stop_emission_by_name (tree_view, "drag-drop");
-	return TRUE;
+	return retval;
 }
 
 /* Callback used when the file list's popup menu is detached */
--
cgit v0.8.2






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-30  0:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30  0:11 [gentoo-commits] gentoo-x86 commit in gnome-base/nautilus/files: nautilus-2.26.4-file-roller-drag-n-drop.patch Nirbheek Chauhan (nirbheek)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox