grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: [BUG] grub2 menu : freeze while initial drawing


From: Vincent Pelletier
Subject: Re: [PATCH] Re: [BUG] grub2 menu : freeze while initial drawing
Date: Sun, 19 Dec 2004 22:57:55 +0100
User-agent: Mozilla Thunderbird 0.9 (X11/20041124)

Here is the patch. :$

Vincent Pelletier
Index: menu.c
===================================================================
RCS file: /cvsroot/grub/grub2/normal/menu.c,v
retrieving revision 1.8
diff -u -p -r1.8 menu.c
--- menu.c      18 Sep 2004 13:42:05 -0000      1.8
+++ menu.c      19 Dec 2004 21:27:40 -0000
@@ -51,7 +51,7 @@
 #define TERM_SCROLL_WIDTH      1
 
 /* The Y position of the top border.  */
-#define TERM_TOP_BORDER_Y      (TERM_MARGIN + TERM_HEIGHT + TERM_MARGIN)
+#define TERM_TOP_BORDER_Y      (TERM_MARGIN + TERM_INFO_HEIGHT + TERM_MARGIN)
 
 /* The X position of the left border.  */
 #define TERM_LEFT_BORDER_X     TERM_MARGIN
@@ -94,31 +94,28 @@ draw_border (void)
   
   grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y);
   grub_putcode (DISP_UL);
-  for (i = 0; i < TERM_BORDER_WIDTH - 2; i++)
+  for (i = 0; i < TERM_BORDER_WIDTH; i++)
     grub_putcode (DISP_HLINE);
   grub_putcode (DISP_UR);
 
-  i = 1;
-  while (1)
+  for(i=0;i<(unsigned) TERM_NUM_ENTRIES;i++)
     {
-      grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + i);
-
-      if (i > (unsigned) TERM_NUM_ENTRIES)
-       break;
-
+      grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + i + 1);
       grub_putcode (DISP_VLINE);
-      grub_gotoxy (TERM_MARGIN + TERM_BORDER_WIDTH - 1, TERM_TOP_BORDER_Y + i);
+      grub_gotoxy (TERM_MARGIN + TERM_BORDER_WIDTH + 1, TERM_TOP_BORDER_Y + i 
+ 1);
       grub_putcode (DISP_VLINE);
 
-      i++;
     }
 
+  grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + TERM_NUM_ENTRIES + 1);
   grub_putcode (DISP_LL);
-  for (i = 0; i < TERM_BORDER_WIDTH - 2; i++)
+  for (i = 0; i < TERM_BORDER_WIDTH; i++)
     grub_putcode (DISP_HLINE);
   grub_putcode (DISP_LR);
 
   grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
+
+  grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + TERM_NUM_ENTRIES + TERM_MARGIN 
+1 );
 }
 
 static void
@@ -172,7 +169,7 @@ print_entry (int y, int highlight, grub_
   grub_gotoxy (TERM_LEFT_BORDER_X + TERM_MARGIN, y);
   grub_putchar (' ');
   for (x = TERM_LEFT_BORDER_X + TERM_MARGIN + 1;
-       x < TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH - 1;
+       x < TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH + 1;
        x++)
     {
       if (*title && x <= TERM_LEFT_BORDER_X + TERM_ENTRY_WIDTH + 1)
@@ -202,7 +199,7 @@ print_entries (grub_menu_t menu, int fir
   if (first)
     grub_putcode (DISP_UP);
   else
-    grub_putchar (' ');
+    grub_putcode (DISP_VLINE);
 
   e = get_entry (menu, first);
 
@@ -219,7 +216,7 @@ print_entries (grub_menu_t menu, int fir
   if (e)
     grub_putcode (DISP_DOWN);
   else
-    grub_putchar (' ');
+    grub_putcode (DISP_VLINE);
 
   grub_gotoxy (TERM_CURSOR_X, TERM_FIRST_ENTRY_Y + offset);
 }

reply via email to

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