From c7b7a299e322cb3fd020354ed42a5d9f914f0046 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 28 Sep 2013 21:36:37 +0400 Subject: [PATCH] Ticket #3084: (dlg_init): fix order of messages sent to widgets during dialog initialization. If checkbox is the first focusable widget in a dialog, it taken the MSG_DRAW message after MSG_FOCUS one and therefore wasn't highlighted. Signed-off-by: Andrew Borodin --- lib/widget/dialog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 7bc1a9ac9..058ae92e9 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -1192,11 +1192,13 @@ dlg_init (WDialog * h) h->state = DLG_ACTIVE; - /* Select the first widget that takes focus */ + /* first send MSG_DRAW to dialog itself and all widgets... */ + dlg_redraw (h); + + /* ...then send MSG_FOCUS to select the first widget that can take focus */ while (h->current != NULL && !dlg_focus (h)) h->current = dlg_widget_next (h, h->current); - dlg_redraw (h); h->ret_value = 0; }