grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] background_color command


From: Colin Watson
Subject: Re: [PATCH] background_color command
Date: Mon, 13 Dec 2010 14:00:29 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

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                                       address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]