These are just a few more bits for themes to optionally
make use of. The throbber gets overlaid with the
progress animation, so they need to be concentric.
The header gets put on top.
We've historically used a expontial function for boot up,
to make it "feel" faster. This equation was invented by
Will Woods.
Making progress linear with boot up is also useful though.
This commit makes it configurable.
The cache file record milestones during boot, so we should
write it out:
1) only after the root filesystem is mounted
2) as soon as we're no longer going to get updates about boot
progress.
The throbber has a function for determining which frame
to show based on the current time. This function was:
ƒrame(t) = number_of_frames ∙ (⅟₂ sin(t) + ⅟₂)
Which basically oscillates between 0 and number_of_frames - 1,
over and over again. There are two problems with this function;
- after it runs through all the frames in order, it then procedes
to run through them backward.
- This function also starts in the middle of the set of throbber
frames.
These problems don't matter for spinfinity, but will look wrong for most
other themes.
The new function is this:
ƒrame(t) = number_of_frames ∙ (1⁄duration)(t mod duration)
This function solves both problems. At time 0 it uses frame 0, and
after the last frame it jumps back to the first frame.
The throbber variable has an is_stopped state
variable that decides whether or not draws happen.
It starts off false, and gets toggled when started.
Unfortunately, it never gets reset to false
after be stopped. This commit fixes that.
boot_buffer may be NULL if plymouthd failed to attach to the console
session (e.g. if booting without an initramfs so /dev/pts isn't mounted
yet). Handle this gracefully rather than segfaulting.
After changing the active vt during start up,
we get a signal when it finishes, because we're in
VT_PROCESS mode, so we don't need to explicitly block
waiting for it to finish.
During the quit path, though, we aren't in VT_PROCESS mode anymore,
won't get any signals, and still need to know that the VT switch
is finished before informing the client that the quit is
finished.
This commit forces ply_terminal_deactivate_vt to block until the
VT switch it initiates finishes.
The system now keeps a list of messages so they can be shown again when the
user flips themes or if the messages were passed before the splash was shown.
This also enables the splashes to show multiple messages (should they choose to
do so). There will later be a way of undisplaying a message.
There is a small window after plymouth is told
to quit or deactivate before it actually does.
During this window, if the user happens to hit
escape, bad things could happen.
We really don't want to mess with, e.g., the tty
settings when we're about to exit.
This commit puts plymouth in a sort of "degraded"
mode while it's deactivating. During this time
frame, user input is ignored.
From time to time, various external programs
will muck with the tty we're using and make
the users password for encrypted disks show
up, make the enter key not work, etc.
We used to work around this by resetting the
tty the way we like it everytime we write the
screen.
We no longer do that after commit
e9a22723da
Instead of changing it every time, it's probably
better to just prevent other programs from messing
up the settings in the first place.
This commit locks the terminal so if those programs
try to change the settings, they fail.
A better long term solution might be to get user input
/dev/input instead of the tty
The x and y offsets were supposed to allow only a part of the image data to be
drawn, but this didn't work correctly. Instead the clip region can be used to
emulate the same effect. So the x and y paramiters in these functions are now
dropped. The only instance that used these now uses a clip. All other calls had
x and y set to zero.
This prevents the event loop from freeing sources
early in an iteration of the loop, and then dispatching
handlers for the source later in that same iteration.
If we don't do this, then the splash display handler will
still be set, causing all sorts of undefined and weird
behavior.
This makes hitting the escape key multiple times act more
reliable.