summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2013-04-19 15:49:54 -0500
committerFederico Mena Quintero <federico@gnome.org>2013-04-19 17:24:03 -0500
commit3815f5d9560c94481b95d24ddb31a8ddce3d213f (patch)
treee4eeb98e2775de4e523907b162df6f4c40f4449f
parentbc0a9a33b0dfa323728590fe6bcbe0815db6d7a8 (diff)
downloadgtk+-3815f5d9560c94481b95d24ddb31a8ddce3d213f.tar.gz
Dropping on the feedback row is always possible
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
-rw-r--r--gtk/gtkplacessidebar.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 2be9b97f67..697dad5cf7 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -1306,6 +1306,12 @@ compute_drop_position (GtkTreeView *tree_view,
drop_possible = TRUE;
+ /* Normalize drops on the feedback row */
+ if (place_type == PLACES_DROP_FEEDBACK) {
+ *pos = GTK_TREE_VIEW_DROP_INTO_OR_BEFORE;
+ goto out;
+ }
+
/* Never drop on headings, but special case the bookmarks heading,
* so we can drop bookmarks in between it and the first bookmark.
*/
@@ -1367,6 +1373,8 @@ compute_drop_position (GtkTreeView *tree_view,
g_free (uri);
}
+out:
+
if (!drop_possible) {
gtk_tree_path_free (*path);
*path = NULL;
@@ -1430,8 +1438,6 @@ start_drop_feedback (GtkPlacesSidebar *sidebar, GtkTreePath *path, GtkTreeViewDr
int new_bookmark_index;
GtkTreeIter iter;
- g_assert (pos == GTK_TREE_VIEW_DROP_BEFORE || pos == GTK_TREE_VIEW_DROP_AFTER);
-
new_bookmark_index = gtk_tree_path_get_indices (path)[0];
if (pos == GTK_TREE_VIEW_DROP_AFTER)
@@ -1518,11 +1524,11 @@ drag_motion_callback (GtkTreeView *tree_view,
PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type,
-1);
- if (section_type == SECTION_BOOKMARKS) {
- if (pos == GTK_TREE_VIEW_DROP_BEFORE || pos == GTK_TREE_VIEW_DROP_AFTER) {
- action = GDK_ACTION_COPY;
- drop_as_bookmarks = TRUE;
- }
+ if (place_type == PLACES_DROP_FEEDBACK
+ || (section_type == SECTION_BOOKMARKS
+ && (pos == GTK_TREE_VIEW_DROP_BEFORE || pos == GTK_TREE_VIEW_DROP_AFTER))) {
+ action = GDK_ACTION_COPY;
+ drop_as_bookmarks = TRUE;
}
if (!drop_as_bookmarks) {