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 624292 - Drag and dropped file at the end of a playlist is misplaced if the playlist takes the full height of the window
Drag and dropped file at the end of a playlist is misplaced if the playlist t...
Status: RESOLVED DUPLICATE of bug 663951
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
: 658736 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-07-13 23:35 UTC by Mahendra Tallur
Modified: 2012-08-20 18:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improved condition of adding the last element to the list. (612 bytes, patch)
2010-08-10 14:36 UTC, Rafal Kupis
none Details | Review

Description Mahendra Tallur 2010-07-13 23:35:45 UTC
Hi !

Short form : When adding a file at the end of the playlist, by drag'n'drop, the file is misplaced if the playlist has a vertical scrollbar.


Long form ; in the following conditions :

- if the playlist already takes up the whole height of the window (thus, has a scrollbar)
- and if one or several files are drag and dropped after the last file of the playlist
-> expected behaviour : the D&D'ed file should be the last file of the playlist
-> obtained behaviour : the D&D'ed file is misplaced, just before the last file of the playlist

The issue is 100% reproducible here. Ubuntun 10.04, Totem 2.30.2.

Cheers !
Comment 1 Rafal Kupis 2010-08-04 14:14:52 UTC
Hi

Bug confirmed, 100% reproducible. In totem_playlist_add_one_mrl (file totem-playlist.c) function gtk_list_store_insert_with_values is used. I debug this part of the code and the argument pos (showing the position of a new song on the list) is valid during the reproduction of error. Maybe problem is in the same function gtk_list_store_insert_with_values.

Best Regards
Comment 2 Rafal Kupis 2010-08-10 14:36:48 UTC
Created attachment 167518 [details] [review]
Improved condition of adding the last element to the list.

The problem exists in a condition of adding the last element to the list (functions: gtk_list_store_insert_with_values and gtk_list_store_insert_with_valuesv, file gtkliststore.c, package libgtk2.0-dev).
Comment 3 Bastien Nocera 2010-08-10 14:43:13 UTC
Rafal, if this is a GTK+ bug, you should file it against GTK+, explain the changes you're making, and create a git formatted patch.
Comment 4 Rafal Kupis 2010-08-13 08:31:51 UTC
Please ignore my last comment. The arrangement of elements on the list is good. The problem is the location of the newly added file in terms of dropping it in the file list, and exactly which in part of the file on list has been dropped (GTK_TREE_VIEW_DROP_BEFORE, GTK_TREE_VIEW_DROP_AFTER). Even if gtk_tree_view_get_path_at_pos function() sets the pointer of library->priv->drop_pos on GTK_TREE_VIEW_DROP_AFTER, the file is placed before current file in the list.
Comment 5 Milan Bouchet-Valat 2011-09-12 15:59:34 UTC
*** Bug 658736 has been marked as a duplicate of this bug. ***
Comment 6 Milan Bouchet-Valat 2011-09-12 16:02:07 UTC
Tentatively moving to GTK+ then. If it helps, see my comments on the two parts of the problem on duplicate bug 658736.

Rafal, would you create the patch as Bastien asked? Thanks! ;-)
Comment 7 Milan Bouchet-Valat 2011-10-02 16:31:12 UTC
Hm, Totem does weird things in totem-playlist.c about the order of files, so that may well be a bug there. I'll try changing this when I get my disk back, leaving here for reference.

	for (i = 0; list[i] != NULL; i++) {
		/* We get the list in the wrong order here,
		 * so when we insert the files at the same position
		 * in the tree, they are in the right order.*/
		file_list = g_list_prepend (file_list, list[i]);
	}

	if (file_list == NULL) {
		gtk_drag_finish (context, FALSE, FALSE, _time);
		return;
	}

	playlist->priv->tree_path = gtk_tree_path_new ();
	gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (playlist->priv->treeview),
					   x, y,
					   &playlist->priv->tree_path,
					   &playlist->priv->drop_pos);

	/* But we reverse the list if we don't have any items in the
	 * list, as we insert new items at the end */
	if (playlist->priv->tree_path == NULL)
		file_list = g_list_reverse (file_list);
Comment 8 Bastien Nocera 2012-08-20 18:37:12 UTC
Was a bug in Totem all along, fixed now.

*** This bug has been marked as a duplicate of bug 663951 ***