From: Ray Strode Date: Sat, 16 Dec 2023 19:45:37 +0000 (-0500) Subject: Revert "ply-pixel-display: Pause the display and unpause it at a framerate" X-Git-Tag: 23.51.283~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdc81fd4f700bb6e0392cf42653f8a40f319b6f0;p=thirdparty%2Fplymouth.git Revert "ply-pixel-display: Pause the display and unpause it at a framerate" This reverts commit 815d3c72e2e4f7299490e43147972e7d31b91d17. This idea of pausing and unpausing updates at a given framerate is good, but doing it at the ply-pixel-display level causes a proble with monitor hotplug. --- diff --git a/src/libply-splash-core/ply-pixel-display.c b/src/libply-splash-core/ply-pixel-display.c index 6de4b1a0..62398038 100644 --- a/src/libply-splash-core/ply-pixel-display.c +++ b/src/libply-splash-core/ply-pixel-display.c @@ -41,10 +41,6 @@ #include "ply-renderer.h" #include "ply-utils.h" -#ifndef FRAMES_PER_SECOND -#define FRAMES_PER_SECOND 60 -#endif - struct _ply_pixel_display { ply_event_loop_t *loop; @@ -62,23 +58,6 @@ struct _ply_pixel_display int pause_count; }; -static void -on_timeout (ply_pixel_display_t *display) -{ - double sleep_time; - - - sleep_time = 1.0 / FRAMES_PER_SECOND; - - ply_pixel_display_unpause_updates (display); - ply_pixel_display_pause_updates (display); - - ply_event_loop_watch_for_timeout (display->loop, - sleep_time, - (ply_event_loop_timeout_handler_t) - on_timeout, display); -} - ply_pixel_display_t * ply_pixel_display_new (ply_renderer_t *renderer, ply_renderer_head_t *head) @@ -203,19 +182,9 @@ ply_pixel_display_set_draw_handler (ply_pixel_display_t *display, ply_pixel_display_draw_handler_t draw_handler, void *user_data) { - double sleep_time; - assert (display != NULL); display->draw_handler = draw_handler; display->draw_handler_user_data = user_data; - - sleep_time = 1.0 / FRAMES_PER_SECOND; - - ply_event_loop_watch_for_timeout (display->loop, - sleep_time, - (ply_event_loop_timeout_handler_t) - on_timeout, display); - ply_pixel_display_pause_updates (display); } diff --git a/src/libply-splash-graphics/ply-console-viewer.c b/src/libply-splash-graphics/ply-console-viewer.c index e423cc40..8e1ee628 100644 --- a/src/libply-splash-graphics/ply-console-viewer.c +++ b/src/libply-splash-graphics/ply-console-viewer.c @@ -158,6 +158,7 @@ update_console_messages (ply_console_viewer_t *console_viewer) if (number_of_messages < 0) return; + ply_pixel_display_pause_updates (console_viewer->display); node = ply_list_get_first_node (console_viewer->message_labels); while (node != NULL) { ply_rich_text_t *line = NULL; @@ -210,6 +211,7 @@ update_console_messages (ply_console_viewer_t *console_viewer) ply_pixel_display_draw_area (console_viewer->display, 0, 0, ply_pixel_display_get_width (console_viewer->display), ply_pixel_display_get_height (console_viewer->display)); + ply_pixel_display_unpause_updates (console_viewer->display); } void