GNOME Bugzilla – Bug 767849
crash in focus handling
Last modified: 2016-06-21 15:59:06 UTC
open the color chooser example in gtk3-demo, go to the color editor, bring up a popover by holding down left button on one of the sliders. Then click in the color pane to move the focus there, and hit Escape:
Thread 1 "lt-gtk3-demo" received signal SIGSEGV, Segmentation fault.
0x00007ffff78621c5 in _gtk_widget_get_parent (widget=0xcec4b0)
321 return widget->priv->parent;
Created attachment 330128 [details] [review]
GtkColorEditor: Keep ref on pre-popup focus widget
And ensure it's still visible before returning the keyboard focus to it.
Because of the extra ref, add a dispose handler that will ensure the
ref is lost (by popping down), although this should be already ensured
through other paths (eg. when the popup widget loses visibility).
This fixes a possible crash in dispose paths, where we might be restoring
focus on an already destroyed widget, and at a time where, if the toplevel
is being itself disposed, no new focus should be set.
Review of attachment 330128 [details] [review]:
Attachment 330128 [details] pushed as f44b9ef - GtkColorEditor: Keep ref on pre-popup focus widget