From 17473a289fe29e863bd10d25fe2a55b93fa7c221 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 21 Jul 2021 05:48:32 +0900 Subject: [PATCH] splash-log: reset display on resolution change --- apps/splash-log.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/splash-log.c b/apps/splash-log.c index 9604c825..0bf58e67 100644 --- a/apps/splash-log.c +++ b/apps/splash-log.c @@ -76,6 +76,7 @@ static void fb_update_message(char * c, int line) { } static void fb_clear_screen(void) { + line_offset = 0; for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { set_point(x,y,BG_COLOR); @@ -108,6 +109,7 @@ static void vga_update_message(char * c, int line) { } static void vga_clear_screen(void) { + line_offset = 0; for (int y = 0; y < 24; ++y) { for (int x = 0; x < 80; ++x) { placech(' ', x, y, 0); /* Clear */ @@ -121,6 +123,12 @@ static void reinit_video(int signum) { ioctl(framebuffer_fd, IO_VID_DEPTH, &depth); ioctl(framebuffer_fd, IO_VID_ADDR, &framebuffer); ioctl(framebuffer_fd, IO_VID_SIGNAL, NULL); + if (signum) { + char screen_update_msg[512]; + snprintf(screen_update_msg, 511, "Display resolution changed to %ldx%ld", width, height); + clear_screen(); + update_message(screen_update_msg,0); + } signal(SIGWINEVENT, reinit_video); }