From d575c7058bcee7dbe2207b340ec1ff17192072fd Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 27 Sep 2016 14:08:42 +0300 Subject: [PATCH] Move winch_pending member from WDialog to WGroup. Signed-off-by: Andrew Borodin --- lib/widget/dialog-switch.c | 4 ++-- lib/widget/dialog.c | 6 ++++-- lib/widget/dialog.h | 1 - lib/widget/group.h | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/widget/dialog-switch.c b/lib/widget/dialog-switch.c index ca131c878..62ab23ce0 100644 --- a/lib/widget/dialog-switch.c +++ b/lib/widget/dialog-switch.c @@ -119,7 +119,7 @@ dialog_switch_resize (WDialog * d) if (widget_get_state (WIDGET (d), WST_ACTIVE)) send_message (d, NULL, MSG_RESIZE, 0, NULL); else - d->winch_pending = TRUE; + GROUP (d)->winch_pending = TRUE; } /* --------------------------------------------------------------------------------------------- */ @@ -293,7 +293,7 @@ dialog_switch_got_winch (void) for (dlg = mc_dialogs; dlg != NULL; dlg = g_list_next (dlg)) if (dlg != mc_current) - DIALOG (dlg->data)->winch_pending = TRUE; + GROUP (dlg->data)->winch_pending = TRUE; } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 5d9be9cf9..9bb6c7938 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -1068,12 +1068,14 @@ update_cursor (WDialog * h) void dlg_draw (WDialog * h) { + WGroup *g = GROUP (h); + if (!widget_get_state (WIDGET (h), WST_ACTIVE)) return; - if (h->winch_pending) + if (g->winch_pending) { - h->winch_pending = FALSE; + g->winch_pending = FALSE; send_message (h, NULL, MSG_RESIZE, 0, NULL); } diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index 477351d5a..4db4e9f8d 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -72,7 +72,6 @@ struct WDialog int ret_value; /* Result of dlg_run() */ /* Internal flags */ - gboolean winch_pending; /* SIGWINCH signal has been got. Resize dialog after rise */ int mouse_status; /* For the autorepeat status of the mouse */ /* Internal variables */ diff --git a/lib/widget/group.h b/lib/widget/group.h index 00b6222c0..8d15fab38 100644 --- a/lib/widget/group.h +++ b/lib/widget/group.h @@ -29,6 +29,8 @@ struct WGroup /* Group members */ GList *widgets; /* widgets list */ GList *current; /* Currently active widget */ + + gboolean winch_pending; /* SIGWINCH signal has been got. Resize group after rise */ }; /*** global variables defined in .c file *********************************************************/