Commit graph

2323 commits

Author SHA1 Message Date
Hans de Goede
b3d42bd5e2 Merge branch 'twostep-bgrt-position-fix' into 'master'
two-step: Fix wrong horizontal position of bgrt logo on left-side-up LCD panels

See merge request plymouth/plymouth!80
2019-10-21 09:39:21 +00:00
Hans de Goede
1ac882f041 two-step: Fix wrong horizontal position of bgrt logo on left-side-up LCD panels
On devices which have their LCD panel mounted 90° rotated with the left-side
of the physical LCD-panel up (at the top), we were using the wrong offset
for placing the bgrt graphics. We were directly using y_offset from the bgrt
as x_offset, but y_offset is from the top of the physical LCD which in this
case is the right side of the panel as seen by the user. Where as our x_offset
is defined to have 0 at the left side.

This commit fixes this issue by flipping the y_offset value on these panels
before using it as our x_offset.

This fixes the logo jumping 6 pixels to the left on an Asus T100HA, which
has such a panel and uses a bgrt y_offset of 512, which results in a flipped
y_offset of 518 (for some reason the log is not entirely centered triggering
this problem).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-21 10:39:52 +02:00
Hans de Goede
fa467eabbf Merge branch 'kbd-indicator-tweaks' into 'master'
keyboard indicator theming improvements

See merge request plymouth/plymouth!79
2019-10-20 12:40:41 +00:00
Hans de Goede
0b8ce37e1a two-step: Change keyboard-indicator positioning to fixed offset below dialog
The keyboard-indicators should be located close to the dialog/entry to
make clear that they belong to each other. Using relative positioning
does not work well for this.

Drop the KeyboardIndicator[Vertic|Horizont]alAlignment options (we have
never done a release with these) and put the keyboard indicators at
a fixed offset (half their height) from the bottom of the dialog instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-17 13:22:14 +02:00
Hans de Goede
8e811f8f88 themes: spinner/bgrt: Modify password dialog to match gnome 3.34 changes
There have been some small tweaks to the gnome lockscreen password
entry filed which we use as template for the diskcrypt password dialog,
adjust our dialog to match these tweaks.

Also move the keyboard indicator to be close to the entry, so that it
is clear it belongs to the entry.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-15 11:33:55 +02:00
Hans de Goede
b867c450e8 gitignore: Add translation related generated files to .gitignore
Add translation related generated files to .gitignore.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-15 11:33:55 +02:00
Hans de Goede
fc3f81addf Merge branch 'drm-upside-down-fix' into 'master'
Drm upside down fix

See merge request plymouth/plymouth!78
2019-10-15 07:07:39 +00:00
Hans de Goede
b2b6df3271 two-step: Remove workaround for upside-down panels
Now that the drm plugin uses hw-rotation for upside down panels when
the GOP does so, there is no need to treat the bgrt rotation for
upside-down panels special anymore,

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-14 08:12:49 +02:00
Hans de Goede
c598440e49 drm: Keep hw-rotation on devices with upside down LCD panels
On devices with an upside down LCD panel and where the hw is capable of
rotating the image to correct this the firmware will program the primary
plane to use hw rotation. When we reset this, this may lead to a small
flicker, where the vendor logo is briefly shown upside down.

A bigger problem is the transition to gdm/mutter. We leave the splash
on screen when mutter loads for a smooth transition,  when mutter turns
hw-rotation back on, the splash turns upside down! And mutter then fades
from the upside-down splash to the login screen, which looks kinda bad.

Keeping the hw-rotation (and disabling our sw rotation) on devices like
this fixes both issues.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-14 00:09:25 +02:00
Hans de Goede
c0b8610be1 drm: Add get_primary_plane_rotation() helper function
Factor most of the code in ply_renderer_head_clear_plane_rotation() out
into a get_primary_plane_rotation() helper, this is a preparation patch
for adding support for using hw-rotation in some cases.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-14 00:09:25 +02:00
Hans de Goede
eae3768673 Merge branch 'systemd-units-fix-hardcoding-run' into 'master'
systemd-ask-password-plymouth.service.in: Do not hardcode /run path to pid file

Closes #26

See merge request plymouth/plymouth!77
2019-10-13 18:03:33 +00:00
Hans de Goede
e0af56113a systemd-ask-password-plymouth.service.in: Do not hardcode /run path to pid file
Use @plymouthruntimedir@/pid in systemd-ask-password-plymouth.service.in so
that the way the path to the pidfile is build there is identical to the
way the --pidfile argument is build in plymouth-start.service.in.

Fixes #26

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 16:56:01 +02:00
Hans de Goede
a28d7aa55d Merge branch 'logrotate' into 'master'
scripts: Add a logrotate file for /var/log/boot.log

Closes #31

See merge request plymouth/plymouth!76
2019-10-13 14:47:56 +00:00
Hans de Goede
5409977505 scripts: Add a logrotate file for /var/log/boot.log
Since plymouth concatenates boot logs one after the other in
/var/log/boot.log, causing it to grow endlessly. we need to logrotrate it.

Fixes #31

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 16:46:42 +02:00
Hans de Goede
e9d6020071 Merge branch 'drm-first-draw-fixes' into 'master'
Drm first draw fixes

See merge request plymouth/plymouth!75
2019-10-13 12:17:03 +00:00
Hans de Goede
ea71bbfaf7 drm: Install our fb after drawing to it
If we need to (re)install our fb as the buffer to scan-out of during
flush, then do so after updating our fb contents, rather then before.

This removes another potential source of flickering.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 12:32:59 +02:00
Hans de Goede
70f2ed850b drm: Delay installing our framebuffer until the first draw
Instead of installing a framebuffer with uninitialized contents, delay
installing our framebuffer until the first (re)draw.

This fixes some ugly flashes when plymout loads in some cases and it
also removes a FIXME comment from the code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 12:32:59 +02:00
Hans de Goede
3750fa3213 Merge branch 'runtimedir' into 'master'
configure: Make runtimedir configurable

Closes #75

See merge request plymouth/plymouth!74
2019-10-13 10:32:14 +00:00
Hans de Goede
79437b1ba9 configure: Make runtimedir configurable
On modern systems we should use /run/plymouth to store things like the
pid file, instead of /var/run/plymouth, make the runtime dir configurable
with --with-runtimedir. This keeps the old default behavior of using
/var/run/plymouth, users can pass --with-runtimedir=/run to use
/run/plymouth instead.

Fixes: #75

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 12:30:00 +02:00
Hans de Goede
a4517f16f0 Merge branch 'hidpi-gfx-glitch-fix' into 'master'
ply-pixel-buffer: Fix bottom edge rendering of scaled buffers

Closes #83

See merge request plymouth/plymouth!73
2019-10-13 08:28:06 +00:00
Hans de Goede
4dff3485d6 ply-pixel-buffer: Fix bottom edge rendering of scaled buffers
Commit 4e1c00b89a (" ply-pixel-buffer: Fix right and bottom edge rendering
of scaled buffers"), which tried to fix a minor rendering issue with the right
and bottom edge of scaled images, contains a typo which actually makes things
worse :|

When checking if iy exceeds the height of the image, ix gets set to the height
instead of iy leading to addressing pass part of the buffer which leads to
various rendering artifacts.

This commit fixes the typo and thus also the artifacts.

Fixes: #83

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-12 12:48:51 +02:00
Hans de Goede
a8aad2799c Merge branch 'keyboard-indicator' into 'master'
Add keyboard layout indicator support

Closes #85

See merge request plymouth/plymouth!71
2019-10-01 08:12:17 +00:00
Hans de Goede
c87a2c07b7 themes: Add images for keyboard indicator support to spinner and spinfinity
Add capslock.png, keyboard.png and keymap-render.png files to the
spinner and spinfinity themes, this enables keyboard indicator
(keymap and capslock state) support for these themes.

capslock.png was made by me drawing the icon in xfig, then export as
svg, at some blank rows at the bottom and save as png. I've added the
capslock.fig file to the spinner theme dir.

keyboard.png comes from google's material-design-icons (original is
apache licensed): https://github.com/google/material-design-icons/
I've also added a copy of the 2 svg source files to the spinner theme dir.

keymap-render.png is generated by scripts/keymap-render.py.

Fixes: #85

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Hans de Goede
05f32bc2ff two-step: Add Keyboard layout indicator support
Use the new keymap-icon control to show a keyboard layout indicator,
when showing a dialog.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Hans de Goede
28cb15c61c capslock-icon: Draw the icon on show
Mark the display area where the icon is as damaged on show to force it
being drawn on show, in case capslock is on at show time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Hans de Goede
665c2852af libply-splash-graphics: Add new keymap-icon control
Add a new control which draws a keyboard-icon + a pre-rendered text
describing the current layout/keymap (as reported by the renderer).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Alberto Ruiz
b26a956a11 scripts: Add keymap-render.py script
Add a script for generating a png with the short-name (ignoring variants)
of all keymaps listed by "localectl list-keymaps" pre-generated.

This scripts also generates a ply-keymap-metadata.h file with info on
which pre-generated keymap name is where in the png.

This will be used in a follow-up commit to add support for a new
keyboard-keymap-icon control to libply-splash-graphics.

Note that this commit does not add the generated keymap-render.png file,
this file will be added to each themes image-dir separately as the color
of the pre-generated text may differ per theme.

Changes by Hans de Goede:
- Change generated metadata into a C header file
- Drop drawing of curved corners, we just want the text
- Add special handling for dvorak

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Hans de Goede
9306edbc17 renderer: Add ply_renderer_get_keymap function
Add a function to get the keymap from a renderer and implement
this for the drm and frame-buffer renderers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Hans de Goede
f91e78f446 terminal: add ply_terminal_get_keymap function
Add a helper function to get the keymap from the terminal.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:43:34 +02:00
Hans de Goede
c00955ce03 key-file: Add support for non ini style config files
In some cases me way want to parse key=value style config files from
outside of plymouth which lack ini style groups.

This commit adds a new ply_key_file_load_groupless_file function which
supports loading such files. When a file is loaded this way, NULL must
be passed as group_name for subsequent ply_key_file_get_* calls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-01 00:10:50 +02:00
Hans de Goede
eb73c37c0d Merge branch 'avoid_build_warning' into 'master'
Use GTK 3.22's way to get screen size

See merge request plymouth/plymouth!51
2019-09-30 09:25:47 +00:00
ZhaoQiang
da9353120a x11-render-plugin: Use GTK 3.22's method to get screen size to avoid
deprecate warning in compile.
2019-09-30 09:19:37 +00:00
Hans de Goede
bb82dc5440 Merge branch 'cleanups' into 'master'
Cleanups

See merge request plymouth/plymouth!70
2019-09-30 09:17:47 +00:00
Hans de Goede
bf6ef0a481 space-flares: Fix compiler warning
Recent gcc versions give the following compiler warning with space-flares:
./plugin.c: In function ‘star_bg_update’:
./plugin.c:762:21: warning: taking the absolute value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect [-Wabsolute-value]
  762 |                 if (abs (((image_data[x + y * width] >> 16) & 0xff) - ((pixel_colour >> 16) & 0xff)) > 8) {
      |                     ^~~

This commit fixes this, assuming that gcc actually optimises the abs()
away, this will also make the code behave as intended again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
c7965ea19a ply-utils: Drop unused ply_string_has_prefix helper
ply_string_has_prefix is no longer used anywhere, drop it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
91185e41e6 main: Use ply_kernel_command_line_get_key_value where appropriate
Switch to ply_kernel_command_line_get_key_value where appropriate.

While at it also fix a mem-leak when falling back override_splash_path from
PLYMOUTH_RUNTIME_THEME_PATH to PLYMOUTH_THEME_PATH.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
11f2017ab7 ply-utils: Add ply_kernel_command_line_get_key_value helper
ply_kernel_command_line_get_string_after_prefix returns the rest of
the commandline after the passed in prefix. When parsing key=value parts
of the commandline, we really only want the value part and stop at the
whitespace separating it from other kernel commandline arguments.

This commit adds a new helper which returns a strdup-ed string containing
just the value; instead of the entire rest of the kernel commandline.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
6bacbbb8ad two-step: Merge show_password_prompt and show_prompt into 1 function
These 2 functions were doing almost the same. Move the setting of the
entry text or bullet count into view_show_prompt were it belongs and
merge these 2 functions into 1 function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
8f04867b74 twp-step: Remove superflous is_hidden / is_stopped checks from on_draw
Remove superflous is_hidden / is_stopped checks from our on_draw
handler. In all 3 cases the is_hidden / is_stopped check guards
a draw_area call, but the draw_area calls themselves contain the
same check, so it checking this in on_draw is not necessary.

Also note that we are already not doing such a check for e.g. the
progress_bar so lets be consistent and remove the check everywhere.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
48de9e64ee two-step: Cleanup stop_animation function
Cleanup the stop_animation function:
- Remove the trigger argument as all callers pass NULL
- Remove the logging of "hiding progress animation" we already log a
  generic "stopping animation" message and we do not log such a message
  for the other animated controls, so remove this one for consistency
- Add a NULL pointer check for view->end_animation, as this can actually
  be NULL when view_load_end_animation fails

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
5dd6e91d2b two-step: Group progress_animaton init together with creation
Move ply_progress_animation_set_transition call up, grouping it with the
ply_progress_animation_new call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-30 11:15:31 +02:00
Hans de Goede
3db248249e Merge branch 'spinfinity-two-step' into 'master'
Move the spinfinity theme to the two-step splash plugin

See merge request plymouth/plymouth!68
2019-09-30 09:04:24 +00:00
Hans de Goede
08490fed8a themes: Move spinifity from the throbgress splash to the two-step splash
At one point in time the two-step splash plugin was forked from the
throbgress splash. Since then the two-step plugin has grown to be more
flexible / configurable.

The two-step plugin is now flexible enough that with the right config
it can mimick the throbgress plugin. Moving the spinifity theme to
use the two-step plugin allows us to remove the throbgress plugin,
removing the code duplication between the 2 plugins.

An added advantage of this is that the two-step plugin has more functionality,
such as capslock indicator support for the password dialog.

Note the throbber-??.png images were modified to add 24 transparant rows at
the top, to get the extra hardcoded throbber-height / 2 space which the
throbgress plugin added between the throbber and the header-image, this
was done automatically using the following command:
convert old.png -background transparent -gravity northwest -splice 0x24 new.png

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-27 09:36:51 +02:00
Hans de Goede
9a78d61057 two-step: Add new UseAnimation setting
Until now we have been disabling the animations when the theme specifies
that a progress-bar should be drawn for the current mode.

This commit adds a new UseAnimation setting which defaults to
!UseProgressBar to preserve the old behavior if UseAnimation is not
set by the theme.

This makes two-step more flexible. Specifically it will allow implementing
the spinfinity theme using two-step; and spinifinity is the only user of
the throbgress plugin, so this will allow removal of that plugin.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-27 09:36:51 +02:00
Hans de Goede
fb8cead071 two-step: Make progress-bar location and size configurable
This commit makes the progress-bar location configurable seperately from
the animation location and it makes the progress-bar size configurable
instead of hardcoding it.

This makes two-step more flexible. Specifically it will allow implementing
the spinfinity theme using two-step; and spinifinity is the only user of
the throbgress plugin, so this will allow removal of that plugin.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-27 09:36:51 +02:00
Hans de Goede
c2d3f7feb4 two-step: Fix progress-bar not hiding when it should
Before this commit we were not hiding the progress-bar when starting the
end-animation nor when stop_animation gets called. This adds the 2 missing
hide calls, making the handling of the progress-bar identical to that of
the progress-animation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-27 09:36:51 +02:00
Hans de Goede
a9d5283ffa two-step: Fix progress-bar not updating on normal boot
We were only calling ply_progress_bar_set_percent_done from the
system_update callback and not from the on_boot_progress callback.

This commit fixes this by adding the missing calls for this to
update_progress_animation and it makes system_update use
update_progress_animation instead of duplicating the code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-27 09:36:51 +02:00
Hans de Goede
48227ed8af two-step: Fold ply_progress_animation_hide call into view_start_end_animation
We should always disable (hide) the progress-animation when
starting the end-animation. Instead of having all callers of
view_start_end_animation do this themselves, do it at the beginning
of view_start_end_animation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-27 09:36:51 +02:00
Hans de Goede
9202b6939a Merge branch 'capslock-indicator' into 'master'
Capslock indicator

See merge request plymouth/plymouth!67
2019-09-27 07:36:12 +00:00
Hans de Goede
dcc5a947d1 two-step: Add a capslock indicator
Add support for showing a capslock indicator when capslock is pressed
while entering a password.

This is automatically enabled if a capslock.png file is present in
the theme's image dir.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-09-26 16:39:46 +02:00