diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index b873177f3..18c0a58b5 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -47,8 +47,14 @@ sub new { $self->Fit; $self->SetMinSize([760, 490]); if (defined $Slic3r::GUI::Settings->{_}{main_frame_size}) { - $self->SetSize([ split ',', $Slic3r::GUI::Settings->{_}{main_frame_size}, 2 ]); - $self->Move([ split ',', $Slic3r::GUI::Settings->{_}{main_frame_pos}, 2 ]); + my $size = [ split ',', $Slic3r::GUI::Settings->{_}{main_frame_size}, 2 ]; + $self->SetSize($size); + + my $display = Wx::Display->new->GetClientArea(); + my $pos = [ split ',', $Slic3r::GUI::Settings->{_}{main_frame_pos}, 2 ]; + if (($pos->[X] + $size->[X]/2) < $display->GetRight && ($pos->[Y] + $size->[Y]/2) < $display->GetBottom) { + $self->Move($pos); + } $self->Maximize(1) if $Slic3r::GUI::Settings->{_}{main_frame_maximized}; } else { $self->SetSize($self->GetMinSize);