Add some wxYield()s.
authorCarl Hetherington <cth@carlh.net>
Thu, 27 Jun 2024 22:40:52 +0000 (00:40 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 11 Oct 2024 19:45:04 +0000 (21:45 +0200)
One or more of these improve GUI responsiveness when downloading
certificates and make it less likely that GNOME complains that
DCP-o-matic has hung.

src/wx/dolby_doremi_certificate_panel.cc
src/wx/download_certificate_panel.cc

index 7f113975304951789b3295fc0425c510caaf1305..5a695ca75f39c81e64cdb4b893b6ebeb5fd86ad7 100644 (file)
@@ -196,6 +196,7 @@ DolbyDoremiCertificatePanel::do_download ()
 
        if (starts_with_digit) {
                try_common(locations, prefix, serial);
+               wxYield();
                try_cat862(locations, prefix, serial);
                try_dsp100(locations, prefix, serial);
        } else if (starting_char == 'H') {
@@ -209,6 +210,7 @@ DolbyDoremiCertificatePanel::do_download ()
        bool ok = false;
        auto location = locations.begin();
        while (!ok && location != locations.end()) {
+               wxYield();
                auto error = get_from_zip_url(location->url, location->file, true, true, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1, _2));
                ++location;
                if (error) {
index 3f1509f60d912eb98832290854c5dbf212bbaec8..f3721fec6da852c6182c13f819171c0f51c90932 100644 (file)
@@ -105,6 +105,7 @@ DownloadCertificatePanel::download ()
 
        /* Hack: without this the SetLabel() above has no visible effect */
        wxMilliSleep (200);
+       wxYield();
 
        signal_manager->when_idle (boost::bind(&DownloadCertificatePanel::do_download, this));
 }