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 559904 - drag-n-drop semantics not right yet (patches included)
drag-n-drop semantics not right yet (patches included)
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-11-08 16:04 UTC by Paul Davis
Modified: 2009-09-30 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
improvements for GdkQuartzWindow.c (2.13 KB, patch)
2008-11-08 16:06 UTC, Paul Davis
none Details | Review
improvements for gdkdnd-quartz.c (4.47 KB, patch)
2008-11-08 16:11 UTC, Paul Davis
none Details | Review
improvements for gtktreeview.c (1.63 KB, patch)
2008-11-08 16:13 UTC, Paul Davis
none Details | Review

Description Paul Davis 2008-11-08 16:04:25 UTC
ignoring the nested-run-loop aspects of drag-n-drop on quartz, there are a few other details that were not being handled correctly. enclosed below are a couple of patches that enable TreeView DnD to work.
Comment 1 Paul Davis 2008-11-08 16:06:23 UTC
Created attachment 122232 [details] [review]
improvements for GdkQuartzWindow.c

this more correctly maps between Quartz DnD operations and GDK ones, and helps the next patch to work correctly.
Comment 2 Paul Davis 2008-11-08 16:11:03 UTC
Created attachment 122233 [details] [review]
improvements for gdkdnd-quartz.c

this one needs careful application because it contains some diffs based on 1 other patches of mine that add supports for getting an image from a drawable. however, more importantly, it more correctly (?) implements some aspects of DnD, in particular gtk_drag_get_source_widget() and better handling of ACTION_MOVE by implementing gtk_drag_finish() so that we will emit a drag-delete at a suitable moment. comments welcome.
Comment 3 Paul Davis 2008-11-08 16:13:57 UTC
Created attachment 122234 [details] [review]
improvements for gtktreeview.c

this correctly sets the source row so that intr-treeview drags will work in the face of Quartz' nested drag-run-loop. its a hack, and it would be nice if Owen's proposal for fixing DnD in #501588 was implemented as an alternative. however, its not very intrusive and in the meantime allows for DnD reordering of treeviews.
Comment 4 Paul Davis 2008-11-10 12:07:22 UTC
ignore these patches for now.

i have subsequently implemented Owen's suggestion of actually starting the drag from a high priority idle callback. combined with his event loop reworking, it works very well and removes any need to the attached hack to GtkTreeView.

there is also a minor bug in one patch above that will cause a crash when handling drags initiated outside of the app.

i am continuing to work on DnD because it is still rather fragile within my app, and i'll post a new pair of patches soon.
Comment 5 Kristian Rietveld 2009-09-25 20:07:44 UTC
Soon we will commit your patch for starting the drag in an idle handler.  Once that is done, is there any work left to do for this bug?
Comment 6 Paul Davis 2009-09-25 20:14:04 UTC
not that i know of. we've been using it in ardour for more than a year, where we do DnD a lot. the patch includes the changes i made to get the semantics right.
Comment 7 Kristian Rietveld 2009-09-30 13:11:30 UTC
Closing this bug now that the full DnD patch has been committed.