macOS: Issues with drag and drop
I discovered a couple issues with drag and drop on macOS, specifically here in this file: https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gdk/quartz/GdkQuartzNSWindow.c#L791
The first problem is that g_object_ref()
should be called on win
, to match the g_object_unref()
here.
The second problem, which I'm not sure how to fix, is that the function doesn't always choose the right destination window. If you have multiple windows underneath the drop point (even on a different workspace!), it will loop through all of them. A simple break
wouldn't work because the wrong window might be chosen.
Steps to reproduce:
- Compile and run this program on a mac: https://paste.gnome.org/p7maecchs
- Put the larger window under the smaller one. Drag and drop from the tree view ("foo" or "bar") to the label that says "drop here".
- After repeating step 2 several times, the bottom window will disappear and a message will be printed to the console: "losing last reference to undestroyed window"
Tested on branch gtk-3-24, compiled from source with meson, on the latest version of macOS.
Edited by James Westman