Received: from list by lists.gnu.org with archive (Exim 4.71) id 1T9uaT-0008BZ-DT for mharc-grub-devel@gnu.org; Fri, 07 Sep 2012 05:10:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9uaM-0007tt-3w for grub-devel@gnu.org; Fri, 07 Sep 2012 05:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9uaF-0003pA-Vg for grub-devel@gnu.org; Fri, 07 Sep 2012 05:10:46 -0400 Received: from mail-vb0-f41.google.com ([209.85.212.41]:35287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9uaF-0003nd-SK for grub-devel@gnu.org; Fri, 07 Sep 2012 05:10:39 -0400 Received: by mail-vb0-f41.google.com with SMTP id v13so3361236vbk.0 for ; Fri, 07 Sep 2012 02:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=8b/nLBA4r0EsLHyoz8NGNmNaNIMcFIo+aIfJbkVk1J0=; b=azc6rnc/fzdAi8V2Mu9RZlBHcfocRs++AMfTYOwZMog7cas0m6WaUuzQsJlXnmEfOC nvrOtVxqqoA8ghkWuybCCh9Mp1hzlERJ9b0Y47+TgIcP+ZvEUHO1P36R2nLJ/P2j6V3y nJwxBBRkfqQL6dBs993liPgkts2emsVooiG7q036+SKvZaG60rc+lieUxKBdKtg0fcLv Iw4ABfqlN7ug9jwY2Tmel0u/C9UDvUdP5ddQ5UXr0QxZ7mKY2GiIUxC/9Dcpgk9Y3pZ5 yhhtvxlNBAfyiithuWs/dTNG5eq91r8Dg/UA2ey2wYOxH8zg7O+AUEzvtxJRGWjaaxsD CGew== Received: by 10.52.22.40 with SMTP id a8mr5172223vdf.4.1347009039686; Fri, 07 Sep 2012 02:10:39 -0700 (PDT) Received: from localhost.localdomain ([130.57.30.250]) by mx.google.com with ESMTPS id da9sm3143746vdc.11.2012.09.07.02.10.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 02:10:39 -0700 (PDT) Sender: =?UTF-8?B?5by15paH6I+v?= From: Michael Chang To: grub-devel@gnu.org Subject: [PATCH 2/2] Fix font color not set for booting message Date: Fri, 7 Sep 2012 17:08:15 +0800 Message-Id: <1347008895-30048-2-git-send-email-mchang@suse.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1347008895-30048-1-git-send-email-mchang@suse.com> References: <1347008895-30048-1-git-send-email-mchang@suse.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.41 Cc: Michael Chang X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 09:10:47 -0000 The set color_normal= is not applied to booting message for loading kernel and initrd. It seems like the user terminal font color is errnously reset to default when performing new screen setup. This patch tries to fix the issue by setting default value during structure initialize and not resetting afterwards. This ensures persistence of user's setting to terminal's font color. Signed-off-by: Michael Chang --- grub-core/term/gfxterm.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c index ecb8e22..b978b27 100644 --- a/grub-core/term/gfxterm.c +++ b/grub-core/term/gfxterm.c @@ -113,7 +113,7 @@ static struct grub_video_render_target *render_target; void (*grub_gfxterm_decorator_hook) (void) = NULL; struct grub_video_bitmap *bitmap_hook = NULL; static struct grub_gfxterm_window window; -static struct grub_virtual_screen virtual_screen; +static struct grub_virtual_screen virtual_screen = { .term_color = GRUB_TERM_DEFAULT_NORMAL_COLOR }; static grub_gfxterm_repaint_callback_t repaint_callback; static int repaint_scheduled = 0; static int repaint_was_scheduled = 0; @@ -187,13 +187,19 @@ clear_char (struct grub_colored_char *c) static void grub_virtual_screen_free (void) { + grub_uint8_t saved_term_color; + /* If virtual screen has been allocated, free it. */ if (virtual_screen.text_buffer != 0) grub_free (virtual_screen.text_buffer); + saved_term_color = virtual_screen.term_color; + /* Reset virtual screen data. */ grub_memset (&virtual_screen, 0, sizeof (virtual_screen)); + virtual_screen.term_color = saved_term_color; + /* Free render targets. */ grub_video_delete_render_target (text_layer); text_layer = 0; @@ -254,8 +260,6 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, virtual_screen.standard_color_setting = DEFAULT_STANDARD_COLOR; - virtual_screen.term_color = GRUB_TERM_DEFAULT_NORMAL_COLOR; - set_term_color (virtual_screen.term_color); grub_video_set_active_render_target (render_target); -- 1.7.3.4