diff options
| author | Ray Strode <rstrode@redhat.com> | 2007-06-06 10:16:38 -0400 |
|---|---|---|
| committer | Ray Strode <rstrode@redhat.com> | 2007-06-06 10:16:38 -0400 |
| commit | a2bba28d72f050a485bda1387ab6de9931bb68a6 (patch) | |
| tree | 0155642d03de720484d6e9a0c40d7df09a8eb024 /src | |
| parent | d86e8e7e69621b890ccb000bd244fd487ea6e8ec (diff) | |
automatically switch back to text mode when running ply-image-test for a while
Diffstat (limited to 'src')
| -rw-r--r-- | src/ply-image.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ply-image.c b/src/ply-image.c index 3de34d1..7cf3689 100644 --- a/src/ply-image.c +++ b/src/ply-image.c @@ -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); |
