]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
automatically switch back to text mode when running ply-image-test for a while
authorRay Strode <rstrode@redhat.com>
Wed, 6 Jun 2007 14:16:38 +0000 (10:16 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 6 Jun 2007 14:16:38 +0000 (10:16 -0400)
src/ply-image.c

index 3de34d15ad86f3537567f0a5d59a56a116981368..7cf36894a62d09663a6bea35d0b74ad48a7987a1 100644 (file)
@@ -282,6 +282,8 @@ ply_image_get_height (ply_image_t *image)
 #define FRAMES_PER_SECOND 50
 #endif
 
+static int console_fd;
+
 static bool
 hide_cursor (void)
 {
@@ -347,6 +349,9 @@ animate_at_time (ply_frame_buffer_t *buffer,
                                                      0, 0, width, height, 
                                                      data, opacity);
   ply_frame_buffer_unpause_updates (buffer);
+
+  if (time > 60.0)
+    ioctl (console_fd, KDSETMODE, KD_TEXT);
 }
 
 static void
@@ -393,7 +398,9 @@ main (int    argc,
       return exit_code;
     }
 
-  //ioctl (1, KDSETMODE, KD_GRAPHICS);
+  console_fd = open ("/dev/tty0", O_RDWR);
+  ioctl (console_fd, KDSETMODE, KD_GRAPHICS);
+  daemon (false, false);
 
   signal (SIGINT, exit);
   signal (SIGTERM, on_death);