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 705605 - Improve the spring-back animation for drag and drop
Improve the spring-back animation for drag and drop
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-08-07 10:34 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-08-14 11:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkiconview: Remove the border and background from drag icons (2.93 KB, patch)
2013-08-07 10:34 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
gtkiconview: Take padding into account when getting the cursor hotspot (1.10 KB, patch)
2013-08-07 10:34 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
gtkdnd: Use a more modern spring back animation for cancelled drags (4.96 KB, patch)
2013-08-07 10:34 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
gtkdnd: Introduce a new API for more accurate drag origin data (14.98 KB, patch)
2013-08-07 10:34 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
gtktextutil: Remove the border and background from drag icons (5.29 KB, patch)
2013-08-07 15:58 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
gtkdnd: Use a more modern spring back animation for cancelled drags (4.93 KB, patch)
2013-08-07 15:59 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
gtkdnd: Introduce a new API for more accurate drag origin data (16.70 KB, patch)
2013-08-07 16:01 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-08-07 10:34:39 UTC
Right now, the drag and drop animation looks awful and chunky. Fix it up
to use a tick callback and a smooth, eased animation.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-08-07 10:34:42 UTC
Created attachment 251048 [details] [review]
gtkiconview: Remove the border and background from drag icons

This doesn't look good when combined with rounded corners on
selected items.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-08-07 10:34:46 UTC
Created attachment 251049 [details] [review]
gtkiconview: Take padding into account when getting the cursor hotspot

This makes the icon view look completely seamless when dragging.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-08-07 10:34:51 UTC
Created attachment 251050 [details] [review]
gtkdnd: Use a more modern spring back animation for cancelled drags
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-08-07 10:34:55 UTC
Created attachment 251051 [details] [review]
gtkdnd: Introduce a new API for more accurate drag origin data

When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. As most widgets use a drag threshold to
determine when to drag, it should be fairly easy to adapt to the
new APIs.
Comment 5 Matthias Clasen 2013-08-07 12:09:09 UTC
Review of attachment 251048 [details] [review]:

looks fine
Comment 6 Matthias Clasen 2013-08-07 12:09:22 UTC
Review of attachment 251048 [details] [review]:

looks fine
Comment 7 Matthias Clasen 2013-08-07 12:09:51 UTC
Review of attachment 251049 [details] [review]:

ok
Comment 8 Matthias Clasen 2013-08-07 12:10:58 UTC
Review of attachment 251050 [details] [review]:

ok
Comment 9 Matthias Clasen 2013-08-07 12:18:55 UTC
Review of attachment 251051 [details] [review]:

::: gtk/gtkdnd.c
@@ +2448,3 @@
 			 gint               button,
+			 GdkEvent          *event,
+                         GdkPoint          *coords)

GdkPoint ?! I'd rather just take x/y separately.

@@ +2639,2 @@
 /**
+ * gtk_drag_begin_full: (method)

Do we need that annotation ? I'm almost positive this breaks gtk-doc

@@ +2646,3 @@
+ * @event: The event that triggered the start of the drag.
+ * @x: The initial x coordinate to start dragging from
+ * @y: The initial y coordinate to start dragging from

Should say what coordinate system x/y are in

@@ +2654,3 @@
+ *
+ * The @event is used to retrieve the timestamp that will be used internally to
+ * grab the pointer.  If @event is #NULL, then GDK_CURRENT_TIME will be used.

Should be %NULL and %GDK_CURRENT_TIME

@@ +2657,3 @@
+ * However, you should try to pass a real event in all cases, since that can be
+ * used by GTK+ to get information about the start position of the drag, for
+ * example if the @event is a %GDK_MOTION_NOTIFY.

I'd rather say: 'if the event is a motion event'

@@ +2679,3 @@
+ * Return value: (transfer none): the context for this drag.
+ *
+ * Deprecated: 3.10: Use gtk_drag_begin_full() instead.

This doesn't belong here
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-08-07 15:54:57 UTC
Attachment 251048 [details] pushed as d72252c - gtkiconview: Remove the border and background from drag icons
Attachment 251049 [details] pushed as 5674f2c - gtkiconview: Take padding into account when getting the cursor hotspot
Comment 11 Jasper St. Pierre (not reading bugmail) 2013-08-07 15:58:29 UTC
Created attachment 251083 [details] [review]
gtktextutil: Remove the border and background from drag icons
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-08-07 15:59:49 UTC
Created attachment 251084 [details] [review]
gtkdnd: Use a more modern spring back animation for cancelled drags
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-08-07 16:01:22 UTC
Created attachment 251086 [details] [review]
gtkdnd: Introduce a new API for more accurate drag origin data

When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-08-13 21:48:14 UTC
Uh, the rest of the patches never got pushed.
Comment 15 Matthias Clasen 2013-08-13 22:29:28 UTC
please push them, then
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-08-14 11:15:56 UTC
Attachment 251083 [details] pushed as 2b2162d - gtktextutil: Remove the border and background from drag icons
Attachment 251084 [details] pushed as e80d1f0 - gtkdnd: Use a more modern spring back animation for cancelled drags
Attachment 251086 [details] pushed as 030b62d - gtkdnd: Introduce a new API for more accurate drag origin data


pushed then