# HG changeset patch # User Sadrul Habib Chowdhury # Date 1200556862 0 # Node ID 6ab4211734063d90e6e8287e10d7e0dd02201123 # Parent 4c28d1e4e284a5039c34d3df342861c26509c516 Focus the button for the default action, if possible. diff -r 4c28d1e4e284 -r 6ab421173406 finch/gntrequest.c --- a/finch/gntrequest.c Sun Jan 13 20:46:20 2008 +0000 +++ b/finch/gntrequest.c Thu Jan 17 08:01:02 2008 +0000 @@ -253,7 +253,7 @@ void *user_data, size_t actioncount, va_list actions) { - GntWidget *window, *box, *button; + GntWidget *window, *box, *button, *focus = NULL; int i; window = setup_request_window(title, primary, secondary, PURPLE_REQUEST_ACTION); @@ -272,9 +272,14 @@ g_object_set_data(G_OBJECT(button), "activate-userdata", user_data); g_object_set_data(G_OBJECT(button), "activate-id", GINT_TO_POINTER(i)); g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(request_action_cb), window); + + if (i == default_value) + focus = button; } gnt_widget_show(window); + if (focus) + gnt_box_give_focus_to_child(GNT_BOX(window), focus); return window; }