]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: Make clearing the dialog-background when using the firmware background...
authorHans de Goede <hdegoede@redhat.com>
Wed, 19 Dec 2018 12:33:08 +0000 (13:33 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 9 Jan 2019 11:29:42 +0000 (12:29 +0100)
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 <hdegoede@redhat.com>
src/plugins/splash/two-step/plugin.c
themes/bgrt/bgrt.plymouth.in

index 0f79795b032d179b05376c9be9c5c10e15bd5392..53f19ee4bca052ab033c719ae05163787b00f46f 100644 (file)
@@ -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 <hdegoede@redhat.com>
  *
  */
 #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);
index dc5eaf5c86c94df66326e35c7b0f538a87da5a6a..86c26229d9bdc86f6cd111a024d97a0e0d45264c 100644 (file)
@@ -14,3 +14,4 @@ TransitionDuration=0.0
 BackgroundStartColor=0x202020
 BackgroundEndColor=0x202020
 UseFirmwareBackground=true
+DialogClearsFirmwareBackground=true