From 5169a9dd957953031445969cb79f93258b36090b Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 8 Nov 2016 14:10:24 +0300 Subject: [PATCH] Ticket #3714: (dialog_change_screen_size): fix dialog resizing order. Signed-off-by: Andrew Borodin --- lib/widget/dialog-switch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/widget/dialog-switch.c b/lib/widget/dialog-switch.c index 399eafa9c..0c7b6c4c9 100644 --- a/lib/widget/dialog-switch.c +++ b/lib/widget/dialog-switch.c @@ -114,12 +114,8 @@ dialog_switch_goto (GList * dlg) /* --------------------------------------------------------------------------------------------- */ static void -dlg_resize_cb (void *data, void *user_data) +dialog_switch_resize (WDialog * d) { - WDialog *d = data; - - (void) user_data; - if (widget_get_state (WIDGET (d), WST_ACTIVE)) send_message (d, NULL, MSG_RESIZE, 0, NULL); else @@ -366,6 +362,8 @@ mc_refresh (void) void dialog_change_screen_size (void) { + GList *d; + mc_global.tty.winch_flag = 0; tty_change_screen_size (); @@ -377,8 +375,10 @@ dialog_change_screen_size (void) /* Inform all suspending dialogs */ dialog_switch_got_winch (); - /* Inform all running dialogs */ - g_list_foreach (top_dlg, (GFunc) dlg_resize_cb, NULL); + + /* Inform all running dialogs from first to last */ + for (d = g_list_last (top_dlg); d != NULL; d = g_list_previous (d)) + dialog_switch_resize (DIALOG (d->data)); /* Now, force the redraw */ repaint_screen ();