Apparently, with GTK3 gdk_drag_begin()
accesses fields from the passed in event that aren't copyable by value -- whereas it worked with GTK2. So, one need to properly use gdk_event_copy()
instead of ev = *event
to copy the event.
Without this, starting a drag with a GTK3 Scintilla accesses freed memory.
Attached is the output from Valgrind when starting a drag under GTK3.
Example patch, but since I don't really know C++ it's probably quite ugly where it does non-C things.
BTW,
gdk_event_copy()
seems to exists since forever: https://developer.gnome.org/gdk2/stable/gdk2-Events.html#gdk-event-copySo there probably is no need to have different code paths for GTK2 and 3.
Committed as [e48831].
Related
Commit: [e48831]