diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 23e6d186b..70c7c4849 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -723,9 +723,7 @@ create_dlg (gboolean modal, int y1, int x1, int lines, int cols, new_d = g_new0 (Dlg_head, 1); new_d->modal = modal; if (colors != NULL) - { memmove (new_d->color, colors, sizeof (dlg_colors_t)); - } new_d->help_ctx = help_ctx; new_d->callback = (callback != NULL) ? callback : default_dlg_callback; new_d->x = x1; @@ -750,6 +748,9 @@ create_dlg (gboolean modal, int y1, int x1, int lines, int cols, g_free (t); } + /* unique name got event group for this dialog */ + new_d->event_group = g_strdup_printf ("%s_%p", MCEVENT_GROUP_DIALOG, (void *) new_d); + return new_d; } @@ -1156,6 +1157,8 @@ destroy_dlg (Dlg_head * h) dlg_broadcast_msg (h, WIDGET_DESTROY, FALSE); g_list_foreach (h->widgets, (GFunc) g_free, NULL); g_list_free (h->widgets); + mc_event_group_del (h->event_group); + g_free (h->event_group); g_free (h->title); g_free (h); diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index ae436111f..8f004286c 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -141,6 +141,7 @@ struct Dlg_head GList *widgets; /* widgets list */ GList *current; /* Curently active widget */ void *data; /* Data can be passed to dialog */ + char *event_group; /* Name of event group for this dialog */ dlg_cb_fn callback; dlg_shortcut_str get_shortcut; /* Shortcut string */