mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-07 06:08:00 +02:00
script: Support ConsoleViewerPreserveBackground option to keep the background when the console viewer is active
This commit is contained in:
parent
22fd5bfde4
commit
759f883301
3 changed files with 13 additions and 4 deletions
|
|
@ -103,6 +103,7 @@ struct _ply_boot_splash_plugin
|
|||
uint32_t should_show_console_messages : 1;
|
||||
ply_buffer_t *boot_buffer;
|
||||
uint32_t console_text_color;
|
||||
uint32_t console_viewer_preserve_background;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
|
@ -236,6 +237,9 @@ create_plugin (ply_key_file_t *key_file)
|
|||
"ConsoleLogTextColor",
|
||||
PLY_CONSOLE_VIEWER_LOG_TEXT_COLOR);
|
||||
|
||||
plugin->console_viewer_preserve_background =
|
||||
ply_key_file_get_bool (key_file, "script", "ConsoleViewerPreserveBackground");
|
||||
|
||||
plugin->displays = ply_list_new ();
|
||||
|
||||
return plugin;
|
||||
|
|
@ -334,7 +338,8 @@ start_script_animation (ply_boot_splash_plugin_t *plugin)
|
|||
plugin->displays,
|
||||
plugin->boot_buffer,
|
||||
plugin->monospace_font,
|
||||
plugin->console_text_color);
|
||||
plugin->console_text_color,
|
||||
plugin->console_viewer_preserve_background);
|
||||
plugin->script_plymouth_lib = script_lib_plymouth_setup (plugin->script_state,
|
||||
plugin->mode,
|
||||
FRAMES_PER_SECOND,
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ static void script_lib_draw_brackground (ply_pixel_buffer_t *pixel_buffer,
|
|||
ply_rectangle_t *clip_area,
|
||||
script_lib_sprite_data_t *data)
|
||||
{
|
||||
if (data->should_show_console_messages) {
|
||||
if (data->should_show_console_messages && data->console_viewer_preserve_background == false) {
|
||||
ply_pixel_buffer_fill_with_hex_color (pixel_buffer, clip_area, 0);
|
||||
return;
|
||||
}
|
||||
|
|
@ -572,7 +572,8 @@ script_lib_sprite_data_t *script_lib_sprite_setup (script_state_t *state,
|
|||
ply_list_t *pixel_displays,
|
||||
ply_buffer_t *boot_buffer,
|
||||
char *monospace_font,
|
||||
uint32_t console_text_color)
|
||||
uint32_t console_text_color,
|
||||
bool console_viewer_preserve_background)
|
||||
{
|
||||
ply_list_node_t *node;
|
||||
script_lib_sprite_data_t *data = malloc (sizeof(script_lib_sprite_data_t));
|
||||
|
|
@ -584,6 +585,7 @@ script_lib_sprite_data_t *script_lib_sprite_setup (script_state_t *state,
|
|||
data->boot_buffer = boot_buffer;
|
||||
data->monospace_font = monospace_font;
|
||||
data->console_text_color = console_text_color;
|
||||
data->console_viewer_preserve_background = console_viewer_preserve_background;
|
||||
|
||||
for (node = ply_list_get_first_node (pixel_displays);
|
||||
node;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ typedef struct
|
|||
ply_buffer_t *boot_buffer;
|
||||
char *monospace_font;
|
||||
uint32_t console_text_color;
|
||||
bool console_viewer_preserve_background;
|
||||
bool needs_redraw;
|
||||
bool plugin_console_messages_updating;
|
||||
bool should_show_console_messages;
|
||||
|
|
@ -80,7 +81,8 @@ script_lib_sprite_data_t *script_lib_sprite_setup (script_state_t *state,
|
|||
ply_list_t *displays,
|
||||
ply_buffer_t *boot_buffer,
|
||||
char *monospace_font,
|
||||
uint32_t console_text_color);
|
||||
uint32_t console_text_color,
|
||||
bool console_viewer_preserve_background);
|
||||
void script_lib_sprite_pixel_display_added (script_lib_sprite_data_t *data,
|
||||
ply_pixel_display_t *pixel_display);
|
||||
void script_lib_sprite_pixel_display_removed (script_lib_sprite_data_t *data,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue