From e2af3524445d4c375d4d09ea89f7460fbea4ad5e Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 25 Apr 2023 15:00:33 -0500 Subject: Fix account request field in Pidgin when filtering The field is set to its default value first, filtered, then a notify signal is connected. If the filter excludes the default, then the notification is not fired at this point. So if there's a filter that excludes that default and you don't change the selection from the UI, then nothing will have told the field that the default is not the selection, and the field result will not match what the user thought they selected. Testing Done: Tried a few times in the I'dle Mak'er plugin. Previously, if accounts loaded such that a Demo account is before an XMPP account, then even though the XMPP account appeared in the selector initially, the idle would be attempted on the Demo account. Now it is always the XMPP account as expected from the UI. Reviewed at https://reviews.imfreedom.org/r/2443/ --- pidgin/gtkrequest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index f8d1fd2082..acd557c090 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -1239,14 +1239,14 @@ create_account_field(PurpleRequestField *field, GtkWidget **account_hint) pidgin_account_chooser_set_selected(PIDGIN_ACCOUNT_CHOOSER(widget), account); + g_signal_connect(widget, "notify::account", G_CALLBACK(field_account_cb), + field); + if(GTK_IS_FILTER(filter)) { pidgin_account_chooser_set_filter(PIDGIN_ACCOUNT_CHOOSER(widget), filter); g_object_unref(filter); } - g_signal_connect(widget, "notify::account", G_CALLBACK(field_account_cb), - field); - type_hint = purple_request_field_get_type_hint(field); if(purple_strequal(type_hint, "account")) { *account_hint = widget; -- cgit v1.2.1