find_window_size.
fix a bug: integrate SIG{CONT} for re-checking window size.
the way it's currently written, first call to compute_playfield will
call itself once. But it makes for less code.
# ex:ts=8 sw=4:
-# $OpenBSD: AddCreateDelete.pm,v 1.38 2016/06/23 16:11:23 espie Exp $
+# $OpenBSD: AddCreateDelete.pm,v 1.39 2016/06/24 11:42:30 espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
return shift->{interactive}->is_interactive;
}
-sub window_size_changed
+sub find_window_size
{
- shift->{progressmeter}->compute_playfield;
+ my ($state, $cont) = @_;
+ $state->SUPER::find_window_size;
+ $state->{progressmeter}->compute_playfield($cont);
}
sub confirm
# ex:ts=8 sw=4:
-# $OpenBSD: Term.pm,v 1.37 2016/06/23 16:11:23 espie Exp $
+# $OpenBSD: Term.pm,v 1.38 2016/06/24 11:42:30 espie Exp $
#
# Copyright (c) 2004-2007 Marc Espie <espie@openbsd.org>
#
sub compute_playfield
{
- my $self = shift;
+ my ($self, $cont) = @_;
$self->{playfield} = $self->width - length($self->{header}) - 7;
# we can print to 80 columns
if ($self->{glitch} && $self->{state}->config->istrue("fullwidth")) {
if ($self->{playfield} < 5) {
$self->{playfield} = 0;
}
+ if ($cont) {
+ $self->{continued} = 1;
+ }
}
sub set_header
my ($self, $header) = @_;
$self->{header} = $header;
$self->compute_playfield;
- $SIG{'CONT'} = sub {
- $self->{continued} = 1;
- };
return 1;
}
# ex:ts=8 sw=4:
-# $OpenBSD: State.pm,v 1.36 2016/06/23 16:11:23 espie Exp $
+# $OpenBSD: State.pm,v 1.37 2016/06/24 11:42:30 espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
$self->{height} = $l[1];
$SIG{'WINCH'} = sub {
$self->find_window_size;
- $self->window_size_changed;
};
}
-}
-
-sub window_size_changed
-{
+ $SIG{'CONT'} = sub {
+ $self->find_window_size(1);
+ }
}
OpenBSD::Auto::cache(signer_list,