GNOME Bugzilla – Bug 559904
drag-n-drop semantics not right yet (patches included)
Last modified: 2009-09-30 13:11:30 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.
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.
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.
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.
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.
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?
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.
Closing this bug now that the full DnD patch has been committed.