From d62be07815fc4830c5630c9b52a5b7ec08c62637 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 19 Dec 2018 13:33:08 +0100 Subject: [PATCH] two-step: Make clearing the dialog-background when using the firmware background optional Since the ask-for-password or ask-question dialog and the firmware background may intersect so far we've been clearing the screen to black when showing a dialog and using the firmware background. This is not always desirable, this commit adds a new "DialogClearsFirmwareBackground" option to the two-step based theme config file, which enables this behavior when set. The new default is to keep using the initial (firmware) background when showing a dialog, which matches the non firmware-background paths. Also update the bgrt theme to use the "DialogClearsFirmwareBackground" option, keeping the current behavior for that theme. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 10 +++++++--- themes/bgrt/bgrt.plymouth.in | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 0f79795b..53f19ee4 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2009 Red Hat, Inc. + * Copyright (C) 2009-2019 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * - * Written by: William Jon McCann + * Written by: William Jon McCann, Hans de Goede * */ #include "config.h" @@ -138,6 +138,7 @@ struct _ply_boot_splash_plugin uint32_t is_visible : 1; uint32_t is_animating : 1; uint32_t is_idle : 1; + uint32_t dialog_clears_firmware_background : 1; }; ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void); @@ -846,6 +847,9 @@ create_plugin (ply_key_file_t *key_file) if (ply_key_file_get_bool (key_file, "two-step", "UseFirmwareBackground")) plugin->background_bgrt_image = ply_image_new ("/sys/firmware/acpi/bgrt/image"); + plugin->dialog_clears_firmware_background = + ply_key_file_get_bool (key_file, "two-step", "DialogClearsFirmwareBackground"); + progress_function = ply_key_file_get_value (key_file, "two-step", "ProgressFunction"); if (progress_function != NULL) { @@ -1081,7 +1085,7 @@ draw_background (view_t *view, */ if ((plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) && - view->background_is_bgrt) + view->background_is_bgrt && plugin->dialog_clears_firmware_background) ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, 0); else if (view->background_buffer != NULL) ply_pixel_buffer_fill_with_buffer (pixel_buffer, view->background_buffer, 0, 0); diff --git a/themes/bgrt/bgrt.plymouth.in b/themes/bgrt/bgrt.plymouth.in index dc5eaf5c..86c26229 100644 --- a/themes/bgrt/bgrt.plymouth.in +++ b/themes/bgrt/bgrt.plymouth.in @@ -14,3 +14,4 @@ TransitionDuration=0.0 BackgroundStartColor=0x202020 BackgroundEndColor=0x202020 UseFirmwareBackground=true +DialogClearsFirmwareBackground=true -- 2.47.3