GNOME Bugzilla – Bug 51889
calling gtk_editable_copy_clipboard when current event is NULL leads to seg. fault
Last modified: 2011-02-04 16:09:02 UTC
This comes up when doing a copy operation that's initiated from a Bonobo menu in the host, but the copying is from a GtkEditable that's inside a component inside a GtkPlug. The code has half-hearted support for working without an event time, but it's not 100% right. During development, we get a critical, but in the field we get a seg. fault -- I guess G_DISABLE_CHECKS is turned on in gtk releases by default. I'll post a patch.
Created attachment 379 [details] [review] patch to handle NULL properly
One manifestation of this in Nautilus is described in http://bugzilla.eazel.com/show_bug.cgi?id=7587.
[ G_DISABLE_CHECKS is not turned on in GTK+ releases unless the user explicitely builds with --disable-debug. I wouldn't guarantee that nobody builds packages of GTK+ this way; I can only say that Red Hat does not. ] I'm putting this on the 1.2.10 milestone, but I'd would strongly advice working around the problem, by, for instance, calling gtk_main_do_event with a C-c keystroke. (If the entry doesn't have the focus necessarily, then you could do more complicated hacks such as setting a flag, sending an artificial event of some sort to the widget, and doing the copy in a a signal connection to the event. Or, you could cheat and grab the focus on the widget.)
FYI: The first hack inside the parentheses was the one I was already planning to do. I've implemented it and we'll probably use it for Nautilus 1.0.
Fixed in CVS, will be in 1.2.10.