]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Detect if the entry is hidden and don't draw it in that case
authorRay Strode <rstrode@redhat.com>
Tue, 5 Aug 2008 21:21:47 +0000 (17:21 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 5 Aug 2008 21:28:26 +0000 (17:28 -0400)
src/libplybootsplash/ply-entry.c
src/libplybootsplash/ply-entry.h
src/splash-plugins/spinfinity/plugin.c

index 0145ab49be4a4ecf5f26ecfedd11dbb53eff0a15..074493b3c26f8c2bc89231e3efb3dfd673c8b06a 100644 (file)
@@ -67,6 +67,8 @@ struct _ply_entry
 
   int number_of_bullets;
   int max_number_of_visible_bullets;
+
+  uint32_t is_hidden : 1;
 };
 
 ply_entry_t *
@@ -89,6 +91,8 @@ ply_entry_new (const char *image_dir)
   entry->bullet_image = ply_image_new (image_path);
   free (image_path);
 
+  entry->is_hidden = true;
+
   return entry;
 }
 
@@ -145,6 +149,9 @@ ply_entry_draw (ply_entry_t *entry)
   uint32_t *text_field_data, *bullet_data;
   int i, number_of_visible_bullets;
 
+  if (entry->is_hidden)
+    return;
+
   ply_frame_buffer_pause_updates (entry->frame_buffer);
 
   text_field_data = ply_image_get_data (entry->text_field_image);
@@ -219,6 +226,8 @@ ply_entry_show (ply_entry_t      *entry,
   entry->area.x = x;
   entry->area.y = y;
 
+  entry->is_hidden = false;
+
   ply_entry_draw (entry);
 }
 
@@ -229,6 +238,15 @@ ply_entry_hide (ply_entry_t *entry)
 
   entry->frame_buffer = NULL;
   entry->window = NULL;
+  entry->loop = NULL;
+
+  entry->is_hidden = true;
+}
+
+bool
+ply_entry_is_hidden (ply_entry_t *entry)
+{
+  return entry->is_hidden;
 }
 
 long
index 81dd23d1411dd400793900dc12f4a66d6285b4f1..c701185c01c59a3f51f095858be24d80b3935aa0 100644 (file)
@@ -44,6 +44,7 @@ void ply_entry_show (ply_entry_t         *entry,
                      long                 y);
 void ply_entry_hide (ply_entry_t *entry);
 void ply_entry_draw (ply_entry_t *entry);
+bool ply_entry_is_hidden (ply_entry_t *entry);
 
 long ply_entry_get_width (ply_entry_t *entry);
 long ply_entry_get_height (ply_entry_t *entry);
index 7baba6157217ca8781efc78702f6f8e388c43c7d..b4fe3bb3abb4ffd210c3ed0985cc421ada7cc8a7 100644 (file)
@@ -449,8 +449,13 @@ ask_for_password (ply_boot_splash_plugin_t *plugin,
 {
   plugin->pending_password_answer = answer;
 
-  stop_animation (plugin);
-  show_password_entry (plugin);
+  if (ply_entry_is_hidden (plugin->entry))
+    {
+      stop_animation (plugin);
+      show_password_entry (plugin);
+    }
+  else
+    ply_entry_draw (plugin->entry);
 }
 
 ply_boot_splash_plugin_interface_t *