Ticket #822: 822.patch

File 822.patch, 965 bytes (added by blakew, 4 years ago)
  • lib/Padre/Wx/Main.pm

     
    612612    return; 
    613613} 
    614614 
     615sub _xy_on_screen { 
     616    # Returns true if the initial xy coordinate is on the screen 
     617    # See ticket #822 
     618    my $self = shift; 
     619    my $config = $self->config; 
     620    if ( $config->main_top < 0 or $config->main_left < 0 ) { 
     621        return 0; 
     622    } 
     623    # Add check for values > screen size? 
     624    1; 
     625} 
     626 
    615627sub _timer_post_init { 
    616628    my $self    = shift; 
    617629    my $config  = $self->config; 
     
    629641    # size, reposition to the defaults). 
    630642    # This must happen AFTER the initial ->Show(1) because otherwise 
    631643    # ->IsShownOnScreen returns a false-negative result. 
    632     unless ( $self->IsShownOnScreen ) { 
     644    unless ( $self->IsShownOnScreen and $self->_xy_on_screen ) { 
    633645        $self->SetSize( 
    634646            Wx::Size->new( 
    635647                $config->default('main_width'),