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 585807 - Drag-and-drop of items downwards drops one too low
Drag-and-drop of items downwards drops one too low
Status: RESOLVED WONTFIX
Product: alacarte
Classification: Applications
Component: general
0.11.x
Other All
: Normal minor
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-06-15 06:17 UTC by Richard Schwarting
Modified: 2012-07-16 02:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Patch fixes downward dragging placement (564 bytes, patch)
2009-06-15 06:55 UTC, Richard Schwarting
none Details | Review

Description Richard Schwarting 2009-06-15 06:17:00 UTC
Please describe the problem:
Say we have items

A
B
C
D
E
F

Say I grab item B and try to move it between C and D, such that the New Placement line is between them.  When I drop B, it instead is placed between D and E.

I suspect it's because this happens:
When you drop B, it 
* records the index of the location it should be moved to 
* then it removes B from that spot and moves up everything else by one
* then it re-adds B to the index previously recorded.

Of course, that index is now off by one, because all the entries were moved up.  Oh no!

Steps to reproduce:
1. open alacarte
2. go to a menu with multiple items
3. drag W down between items X and Y


Actual results:
X and Y are moved up when you drop W, so it gets inserted between Y and Z instead of X and Y.

Expected results:
It should be inserted between the two you saw the placement line between.

Does this happen every time?
Yes.

Other information:
Alacarte feels a bit awkward.  It's kind of like a File System editor from bygone years.  Perhaps mimicing a more modern file system would be better?  A FUSE driver?
Comment 1 Richard Schwarting 2009-06-15 06:20:13 UTC
Right, I'm also intent on not just complaining. 

Fedora 11 shipped with its preferences menu flattened (no more logical subgroupings like they had in Fedora 10), or at least on my two upgraded installations.  

Alacarte was helpful in letting me reorganise that relatively painless (once I realised I had to target the one above what I wanted).  

I appreciate the ability to set separators, and the ability to disable menu items without complete removing them.  I also came to appreciate the unintuitive-to-me Copy By Default when dragging an item to another submenu.  

I think it would be nice to have hierarchical behaviour like this more analogous to the File System, but that might be my previous experience with Explorer speaking.   

Anyway, Alacarte has been handy.  Thanks!
Comment 2 Richard Schwarting 2009-06-15 06:55:28 UTC
Created attachment 136603 [details] [review]
Patch fixes downward dragging placement

In __positionItem, I've added a check to see whether the new position is below the current one, and to anticipate the removal of ones self in that case by decreasing the destination index by 1 :)
Comment 3 Richard Schwarting 2009-06-15 07:03:38 UTC
Right, and the patch is against git master/head/whatever-its-called
Comment 4 Richard Schwarting 2009-11-01 22:30:19 UTC
Can't reproduce anymore.  

Thanks.
Comment 5 Mathieu Trudel-Lapierre 2010-01-27 04:38:25 UTC
This still appears to be an issue as of 0.12.4.

However, Richard Liebscher's patch (http://launchpadlibrarian.net/28985622/MenuEditor.patch) from the bug 395692 on Launchpad appears to correct the issue.
Comment 6 Cosimo Cecchi 2010-03-29 08:24:21 UTC
Ok, so this is not fixed yet.
Comment 7 André Klapper 2012-06-04 13:08:22 UTC
Drag and Drop support has been removed for the time being (might be added again later). See http://git.gnome.org/browse/alacarte/commit/?id=d9d0312a0f38bec6551d0d79d917eac389f0730b