Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-06-06 11:52:19 +0300
committerVojtech Kral <vojtech@kral.hk>2018-06-07 16:41:36 +0300
commitaef0c489e31ad4916b5e93dfb7b17e0200184868 (patch)
tree14abdf2677966b5facd1215c8df1c1b1299da738 /lib
parent2e061994d4a602929658c453aaf32e13751eccc2 (diff)
Fix: Dialog initialization ordering on OS X
Perform update_check after MainFrame is created
Diffstat (limited to 'lib')
-rw-r--r--lib/Slic3r/GUI.pm27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm
index 04dc80323..f2bf3baf8 100644
--- a/lib/Slic3r/GUI.pm
+++ b/lib/Slic3r/GUI.pm
@@ -105,15 +105,6 @@ sub OnInit {
$self->{preset_updater} = Slic3r::PresetUpdater->new($VERSION_ONLINE_EVENT);
Slic3r::GUI::set_preset_updater($self->{preset_updater});
- eval {
- if (! $self->{preset_updater}->config_update()) {
- exit 0;
- }
- };
- if ($@) {
- warn $@ . "\n";
- fatal_error(undef, $@);
- }
Slic3r::GUI::load_language();
@@ -137,6 +128,7 @@ sub OnInit {
);
$self->SetTopWindow($frame);
+ # This makes CallAfter() work
EVT_IDLE($self->{mainframe}, sub {
while (my $cb = shift @cb) {
$cb->();
@@ -144,8 +136,21 @@ sub OnInit {
$self->{app_config}->save if $self->{app_config}->dirty;
});
- # On OSX the UI was not initialized correctly if the wizard was called
- # before the UI was up and running.
+ # On OS X the UI tends to freeze in weird ways if modal dialogs (config wizard, update notifications, ...)
+ # are shown before or in the same event callback with the main frame creation.
+ # Therefore we schedule them for later using CallAfter.
+ $self->CallAfter(sub {
+ eval {
+ if (! $self->{preset_updater}->config_update()) {
+ exit 0;
+ }
+ };
+ if ($@) {
+ warn $@ . "\n";
+ fatal_error(undef, $@);
+ }
+ });
+
$self->CallAfter(sub {
if (! Slic3r::GUI::config_wizard_startup($app_conf_exists)) {
# Only notify if there was not wizard so as not to bother too much ...