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 637104 - don't allow positioning before or after self in dnd
don't allow positioning before or after self in dnd
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-12-12 20:21 UTC by William Jon McCann
Modified: 2011-01-06 13:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
DashDND: Don't allow positioning before or after self (2.00 KB, patch)
2011-01-06 10:43 UTC, drago01
reviewed Details | Review
DashDND: Don't allow positioning before or after self (1.83 KB, patch)
2011-01-06 13:19 UTC, drago01
committed Details | Review

Description William Jon McCann 2010-12-12 20:21:33 UTC
It is pretty silly to allow dropping an icon immediately next to the icon that is being dragged.  We shouldn't allow it.
Comment 1 drago01 2011-01-06 10:43:34 UTC
Created attachment 177638 [details] [review]
DashDND: Don't allow positioning before or after self

Don't allow the icon to be dropped immediately next to
itself.
Comment 2 Florian Müllner 2011-01-06 13:12:07 UTC
Review of attachment 177638 [details] [review]:

Overall looks good, some suggestions below:

::: js/ui/dash.js
@@ +274,3 @@
             return DND.DragMotionResult.NO_DROP;
 
+        let favoritesList = AppFavorites.getAppFavorites().getFavorites();

Not sure about the 'List' suffix for an array - why not just call the variable 'favorites'?

@@ +277,3 @@
+        let numFavorites = favoritesList.length;
+
+        let appPos = -1;

Easier to do

let appPos = favoritesList.indexOf(app);

Also, I think something like favPos is slightly better - it's a bit weird that the dash contains apps with an appPos of -1 ...

@@ +302,3 @@
             if (this._dragPlaceholder)
                 this._dragPlaceholder.destroy();
+            

Whitespace on empty line
Comment 3 drago01 2011-01-06 13:16:33 UTC
(In reply to comment #2)
> Review of attachment 177638 [details] [review]:
> 
> Overall looks good, some suggestions below:
> 
> ::: js/ui/dash.js
> @@ +274,3 @@
>              return DND.DragMotionResult.NO_DROP;
> 
> +        let favoritesList = AppFavorites.getAppFavorites().getFavorites();
> 
> Not sure about the 'List' suffix for an array - why not just call the variable
> 'favorites'?

To not conflict with the 'favorites' used by for the map later in the function ... but I ended up removing it anyway.

> @@ +277,3 @@
> +        let numFavorites = favoritesList.length;
> +
> +        let appPos = -1;
> 
> Easier to do
> 
> let appPos = favoritesList.indexOf(app);
> 
> Also, I think something like favPos is slightly better - it's a bit weird that
> the dash contains apps with an appPos of -1 ...

OK
Comment 4 drago01 2011-01-06 13:19:49 UTC
Created attachment 177650 [details] [review]
DashDND: Don't allow positioning before or after self

Don't allow the icon to be dropped immediately next to
itself.
Comment 5 Florian Müllner 2011-01-06 13:30:22 UTC
Review of attachment 177650 [details] [review]:

Looks good.
Comment 6 drago01 2011-01-06 13:31:50 UTC
Attachment 177650 [details] pushed as cff5039 - DashDND: Don't allow positioning before or after self