GNOME Bugzilla – Bug 572478
Emission of "changed" when selection was changed from "invalid" (index of -1) to "invalid" (index of -1) in a GtkComboBox
Last modified: 2009-03-04 16:58:28 UTC
Please describe the problem: gtk_combo_box_set_active passes a NULL path to gtk_combo_box_set_active_internal if an index of -1 was used. That NULL path is then used in gtk_combo_box_set_active_internal to check whether a selection should be invalid. However, it is not checked whether the selection was already invalid. This leads to the emission of a "changed" signal even though there was no change. Steps to reproduce: 1. Compile the test code from the attachment. 2. Run it and select the first entry in the GtkComboBox. Actual results: The test application SEGVs. Expected results: The selection should be invalidated only once. Does this happen every time? Yes. Other information:
Created attachment 129091 [details] Test case for a recursive emission of "changed" signals.
Created attachment 129092 [details] [review] Patch to add a check when an already invalid selection was set to invalid.
Created attachment 129134 [details] Better testcase that requires no user interaction.
Created attachment 129135 [details] Better testcase that requires no user interaction (duplicated attachment, sorry).
Created attachment 129136 [details] [review] This patch removes a critical bug introduced with the last patch The previous patch stopped signal emission not only for "invalid" to "invalid", but for every change to "invalid".
Looks correct now, please commit.
This is _Michael_ Hasselmann. He doesn't have commit rights.
Murray, I've commited the patch for him. Let Michael the honour to close his first accepted bugfix.
.
Murray, I use the 'accepted-commit-now' status also as a tool for myself. Don't be alarmed if I set it on patches of people without commit rights. The patches will make it in before the next release.
This bugfix triggered a regression in the GtkComboBoxEntry widget: http://bugzilla.gnome.org/show_bug.cgi?id=574059 The offending source: http://svn.gnome.org/viewvc/gtk%2B/trunk/gtk/gtkcomboboxentry.c?revision=20927&view=markup#l288