[gcr] ui: Fix certificate export dialog to not hang the application



commit aabe746d30e23d887018ba6e22530e68377c40d4
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Nov 3 21:36:14 2017 -0500

    ui: Fix certificate export dialog to not hang the application
    
    I don't know why -- I guess something must have changed in GTK+ -- but
    currently the certificate export dialog does nothing except hang. It
    can't receive any user input or anything.
    
    gtk_dialog_run() seems to fix this, so let's use it.
    
    Note we have to adjust the refcounting here now, since if the Cancel
    button is pressed the operation will complete before
    _gcr_certificate_exporter_export_async returns. The function is still
    partially async, but it now blocks until the dialog is closed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789804

 ui/gcr-certificate-exporter.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/ui/gcr-certificate-exporter.c b/ui/gcr-certificate-exporter.c
index 4b76815..5c3e816 100644
--- a/ui/gcr-certificate-exporter.c
+++ b/ui/gcr-certificate-exporter.c
@@ -340,7 +340,7 @@ exporter_display_chooser (GcrCertificateExporter *self)
                g_cancellable_connect (self->pv->cancellable,
                                       G_CALLBACK (on_cancel_chooser_dialog), self, NULL);
 
-       gtk_widget_show (GTK_WIDGET (self->pv->chooser_dialog));
+       gtk_dialog_run (GTK_DIALOG (self->pv->chooser_dialog));
 }
 
 /* -----------------------------------------------------------------------------
@@ -522,10 +522,10 @@ _gcr_certificate_exporter_export_async (GcrCertificateExporter *self,
        if (cancellable)
                self->pv->cancellable = g_object_ref (cancellable);
 
-       exporter_display_chooser (self);
-
        /* Matching in export_finish */
        g_object_ref (self);
+
+       exporter_display_chooser (self);
 }
 
 gboolean


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