From c5957f146bf9f761d94e276c5a760d9eedcfeff4 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 25 Sep 2016 01:06:13 +0200 Subject: [PATCH] app: remove the "filters_dialog" member from GimpDisplayShell and attach the dialog using dialogs_attach_dialog(). --- app/actions/view-commands.c | 17 ++++++++++------- app/display/gimpdisplayshell.h | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c index 1d1863520f..2a9790addf 100644 --- a/app/actions/view-commands.c +++ b/app/actions/view-commands.c @@ -472,18 +472,21 @@ view_display_filters_cmd_callback (GtkAction *action, gpointer data) { GimpDisplayShell *shell; + GtkWidget *dialog; return_if_no_shell (shell, data); - if (! shell->filters_dialog) - { - shell->filters_dialog = gimp_display_shell_filter_dialog_new (shell); +#define FILTERS_DIALOG_KEY "gimp-display-filters-dialog" - g_signal_connect (shell->filters_dialog, "destroy", - G_CALLBACK (gtk_widget_destroyed), - &shell->filters_dialog); + dialog = dialogs_get_dialog (G_OBJECT (shell), FILTERS_DIALOG_KEY); + + if (! dialog) + { + dialog = gimp_display_shell_filter_dialog_new (shell); + + dialogs_attach_dialog (G_OBJECT (shell), FILTERS_DIALOG_KEY, dialog); } - gtk_window_present (GTK_WINDOW (shell->filters_dialog)); + gtk_window_present (GTK_WINDOW (dialog)); } void diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h index 1407fa8b21..be467e1a55 100644 --- a/app/display/gimpdisplayshell.h +++ b/app/display/gimpdisplayshell.h @@ -159,7 +159,6 @@ struct _GimpDisplayShell GimpColorDisplayStack *filter_stack; /* color display conversion stuff */ guint filter_idle_id; - GtkWidget *filters_dialog; /* color display filter dialog */ const Babl *filter_format; /* filter_buffer's format */ GeglBuffer *filter_buffer; /* buffer for display filters */