Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PS8xH-00063r-BF for mharc-grub-devel@gnu.org; Mon, 13 Dec 2010 09:00:43 -0500 Received: from [140.186.70.92] (port=35301 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS8x9-00062T-F3 for grub-devel@gnu.org; Mon, 13 Dec 2010 09:00:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PS8x7-0000Io-Ua for grub-devel@gnu.org; Mon, 13 Dec 2010 09:00:35 -0500 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:60521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PS8x7-0000IC-NB for grub-devel@gnu.org; Mon, 13 Dec 2010 09:00:33 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1PS8x5-0006au-19 for grub-devel@gnu.org; Mon, 13 Dec 2010 14:00:31 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 4.69) (envelope-from ) id 1PS8x3-0005Cs-Us for grub-devel@gnu.org; Mon, 13 Dec 2010 14:00:29 +0000 Date: Mon, 13 Dec 2010 14:00:29 +0000 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20101213140029.GA19899@riva.ucam.org> References: <20101210123941.GX21862@riva.ucam.org> <20101210175342.GA686@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101210175342.GA686@riva.ucam.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] background_color command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Mon, 13 Dec 2010 14:00:37 -0000 On Fri, Dec 10, 2010 at 05:53:42PM +0000, Colin Watson wrote: > Vladimir suggested on IRC that I should generalise the gfxmenu colour > parsing code instead. Here's a patch that does this. I've pushed this > to the parse-color branch here: > > bzr+ssh://bzr.sv.gnu.org/grub/branches/parse-color/ I applied an additional change on top of this, also pushed to that branch. This means that this sequence in grub.cfg works as intended: terminal_output gfxterm background_color 44,0,30 === modified file 'ChangeLog.parse-color' --- ChangeLog.parse-color 2010-12-10 17:47:38 +0000 +++ ChangeLog.parse-color 2010-12-13 13:58:53 +0000 @@ -39,3 +39,9 @@ function. (GRUB_MOD_INIT): Register background_color command. (GRUB_MOD_FINI): Unregister background_color command. + + Fix border repainting. + + * grub-core/term/gfxterm.c (dirty_region_add): When a repaint is + already scheduled, merge the virtual screen with the requested + region rather than repainting only the virtual screen. === modified file 'grub-core/term/gfxterm.c' --- grub-core/term/gfxterm.c 2010-12-10 17:47:38 +0000 +++ grub-core/term/gfxterm.c 2010-12-13 13:58:53 +0000 @@ -539,10 +539,20 @@ dirty_region_add (int x, int y, unsigned if (repaint_scheduled) { - x = virtual_screen.offset_x; - y = virtual_screen.offset_y; - width = virtual_screen.width; - height = virtual_screen.height; + if (x > (int)virtual_screen.offset_x) + { + width += virtual_screen.offset_x - x; + x = virtual_screen.offset_x; + } + if (y > (int)virtual_screen.offset_y) + { + height += virtual_screen.offset_y - y; + y = virtual_screen.offset_y; + } + if (width < virtual_screen.width) + width = virtual_screen.width; + if (height < virtual_screen.height) + height = virtual_screen.height; repaint_scheduled = 0; repaint_was_scheduled = 1; } -- Colin Watson [cjwatson@ubuntu.com]