1 |
nirbheek 09/12/30 00:11:42 |
2 |
|
3 |
Added: nautilus-2.26.4-file-roller-drag-n-drop.patch |
4 |
Log: |
5 |
Fix nautilus window closing when doing DnD from file-roller, bug 290001 |
6 |
(Portage version: 2.1.7.16/cvs/Linux i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 gnome-base/nautilus/files/nautilus-2.26.4-file-roller-drag-n-drop.patch |
10 |
|
11 |
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 |
12 |
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 |
13 |
|
14 |
Index: nautilus-2.26.4-file-roller-drag-n-drop.patch |
15 |
=================================================================== |
16 |
Fixes nautilus window closing when doing DnD from file-roller. |
17 |
Patch is taken from upstream git |
18 |
|
19 |
http://bugs.gentoo.org/show_bug.cgi?id=290001 |
20 |
|
21 |
--- |
22 |
From 23278532505862816bd5c8c0ab7d17f7a07b4790 Mon Sep 17 00:00:00 2001 |
23 |
From: Cosimo Cecchi <cosimoc@×××××.org> |
24 |
Date: Fri, 09 Oct 2009 17:19:42 +0000 |
25 |
Subject: Always check if the drag dest supports the source. |
26 |
|
27 |
In the "drag-motion" callback, make sure we check for target != GDK_NONE |
28 |
before getting non-existent data for it. |
29 |
--- |
30 |
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c |
31 |
index b7e1df2..15b6395 100644 |
32 |
--- a/libnautilus-private/nautilus-dnd.c |
33 |
+++ b/libnautilus-private/nautilus-dnd.c |
34 |
@@ -1010,7 +1010,7 @@ nautilus_drag_selection_includes_special_link (GList *selection_list) |
35 |
return FALSE; |
36 |
} |
37 |
|
38 |
-static void |
39 |
+static gboolean |
40 |
slot_proxy_drag_motion (GtkWidget *widget, |
41 |
GdkDragContext *context, |
42 |
int x, |
43 |
@@ -1038,6 +1038,11 @@ slot_proxy_drag_motion (GtkWidget *widget, |
44 |
|
45 |
if (!drag_info->have_data) { |
46 |
target = gtk_drag_dest_find_target (widget, context, NULL); |
47 |
+ |
48 |
+ if (target == GDK_NONE) { |
49 |
+ goto out; |
50 |
+ } |
51 |
+ |
52 |
gtk_drag_get_data (widget, context, target, time); |
53 |
} |
54 |
|
55 |
@@ -1079,6 +1084,8 @@ out: |
56 |
} |
57 |
|
58 |
gdk_drag_status (context, action, time); |
59 |
+ |
60 |
+ return TRUE; |
61 |
} |
62 |
|
63 |
static void |
64 |
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c |
65 |
index 1d07bba..9a87322 100644 |
66 |
--- a/src/nautilus-places-sidebar.c |
67 |
+++ b/src/nautilus-places-sidebar.c |
68 |
@@ -850,7 +850,7 @@ compute_drop_position (GtkTreeView *tree_view, |
69 |
} |
70 |
|
71 |
|
72 |
-static void |
73 |
+static gboolean |
74 |
get_drag_data (GtkTreeView *tree_view, |
75 |
GdkDragContext *context, |
76 |
unsigned int time) |
77 |
@@ -861,8 +861,14 @@ get_drag_data (GtkTreeView *tree_view, |
78 |
context, |
79 |
NULL); |
80 |
|
81 |
+ if (target == GDK_NONE) { |
82 |
+ return FALSE; |
83 |
+ } |
84 |
+ |
85 |
gtk_drag_get_data (GTK_WIDGET (tree_view), |
86 |
context, target, time); |
87 |
+ |
88 |
+ return TRUE; |
89 |
} |
90 |
|
91 |
static void |
92 |
@@ -928,7 +934,9 @@ drag_motion_callback (GtkTreeView *tree_view, |
93 |
char *uri; |
94 |
|
95 |
if (!sidebar->drag_data_received) { |
96 |
- get_drag_data (tree_view, context, time); |
97 |
+ if (!get_drag_data (tree_view, context, time)) { |
98 |
+ return FALSE; |
99 |
+ } |
100 |
} |
101 |
|
102 |
compute_drop_position (tree_view, x, y, &path, &pos, sidebar); |
103 |
@@ -1269,10 +1277,11 @@ drag_drop_callback (GtkTreeView *tree_view, |
104 |
unsigned int time, |
105 |
NautilusPlacesSidebar *sidebar) |
106 |
{ |
107 |
+ gboolean retval = FALSE; |
108 |
sidebar->drop_occured = TRUE; |
109 |
- get_drag_data (tree_view, context, time); |
110 |
+ retval = get_drag_data (tree_view, context, time); |
111 |
g_signal_stop_emission_by_name (tree_view, "drag-drop"); |
112 |
- return TRUE; |
113 |
+ return retval; |
114 |
} |
115 |
|
116 |
/* Callback used when the file list's popup menu is detached */ |
117 |
-- |
118 |
cgit v0.8.2 |