[gnome-software/wip/rancell/ubuntu-3-20-3: 40/55] Correctly unmap modal dialogs



commit 484496c0acab56f8e34a8bf58988198702dce9c2
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 8 14:18:54 2016 +0100

    Correctly unmap modal dialogs

 src/gs-application.c     |    4 ++++
 src/gs-page.c            |    6 ++++++
 src/gs-shell-details.c   |    6 ++++++
 src/gs-shell-installed.c |    2 ++
 src/gs-shell-updates.c   |    7 +++++++
 src/gs-shell.c           |    4 ++++
 6 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 403dbf3..faea12d 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -380,6 +380,10 @@ about_activated (GSimpleAction *action,
                                                 "software on your system."));
 
        gs_shell_modal_dialog_present (app->shell, GTK_DIALOG (dialog));
+
+       /* just destroy */
+       g_signal_connect_swapped (dialog, "response",
+                                 G_CALLBACK (gtk_widget_destroy), dialog);
 }
 
 static void
diff --git a/src/gs-page.c b/src/gs-page.c
index b7dd9da..30104eb 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -216,6 +216,9 @@ gs_page_update_app_response_cb (GtkDialog *dialog,
 {
        GsPagePrivate *priv = gs_page_get_instance_private (helper->page);
 
+       /* unmap the dialog */
+       gtk_widget_destroy (GTK_WIDGET (dialog));
+
        /* not agreed */
        if (response != GTK_RESPONSE_OK) {
                gs_page_helper_free (helper);
@@ -294,6 +297,9 @@ gs_page_remove_app_response_cb (GtkDialog *dialog,
 {
        GsPagePrivate *priv = gs_page_get_instance_private (helper->page);
 
+       /* unmap the dialog */
+       gtk_widget_destroy (GTK_WIDGET (dialog));
+
        /* not agreed */
        if (response != GTK_RESPONSE_OK) {
                gs_page_helper_free (helper);
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 5566956..d3e235d 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1172,6 +1172,9 @@ gs_shell_details_failed_response_cb (GtkDialog *dialog,
                                     gint response,
                                     GsShellDetails *self)
 {
+       /* unmap the dialog */
+       gtk_widget_destroy (GTK_WIDGET (dialog));
+
        /* switch away from the details view that failed to load */
        gs_shell_set_mode (self->shell, GS_SHELL_MODE_OVERVIEW);
 }
@@ -1464,6 +1467,9 @@ gs_shell_details_review_response_cb (GtkDialog *dialog,
        g_autoptr(GsReview) review = NULL;
        GsReviewDialog *rdialog = GS_REVIEW_DIALOG (dialog);
 
+       /* unmap the dialog */
+       gtk_widget_destroy (GTK_WIDGET (dialog));
+
        /* not agreed */
        if (response != GTK_RESPONSE_OK)
                return;
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 01dbe61..3d5c750 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -626,6 +626,8 @@ show_folder_dialog (GtkButton *button, GsShellInstalled *self)
        dialog = gs_app_folder_dialog_new (GTK_WINDOW (toplevel), apps);
        g_signal_connect_swapped (dialog, "delete-event",
                                  G_CALLBACK (folder_dialog_done), self);
+       g_signal_connect_swapped (dialog, "response",
+                                 G_CALLBACK (gtk_widget_destroy), dialog);
        gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
 }
 
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index f785825..94597fc 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -674,6 +674,10 @@ show_update_details (GsApp *app, GsShellUpdates *self)
        dialog = gs_update_dialog_new (self->plugin_loader);
        gs_update_dialog_show_update_details (GS_UPDATE_DIALOG (dialog), app);
        gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
+
+       /* just destroy */
+       g_signal_connect_swapped (dialog, "response",
+                                 G_CALLBACK (gtk_widget_destroy), dialog);
 }
 
 /**
@@ -786,6 +790,9 @@ gs_shell_updates_refresh_confirm_cb (GtkDialog *dialog,
                                     GtkResponseType response_type,
                                     GsShellUpdates *self)
 {
+       /* unmap the dialog */
+       gtk_widget_destroy (GTK_WIDGET (dialog));
+
        switch (response_type) {
        case GTK_RESPONSE_REJECT:
                /* open the control center */
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 3d69e65..ab9a7ad 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -888,6 +888,10 @@ gs_shell_show_sources (GsShell *shell)
 
        dialog = gs_sources_dialog_new (priv->main_window, priv->plugin_loader);
        gs_shell_modal_dialog_present (shell, GTK_DIALOG (dialog));
+
+       /* just destroy */
+       g_signal_connect_swapped (dialog, "response",
+                                 G_CALLBACK (gtk_widget_destroy), dialog);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]