]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/term/gfxterm.c: Add flag "functional" to skip input when
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 3 Oct 2013 21:32:19 +0000 (23:32 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 3 Oct 2013 21:32:19 +0000 (23:32 +0200)
changing windows to avoid crash.

ChangeLog
grub-core/term/gfxterm.c

index 0a3da2a46a40639563dc4524b27978930f81e6cf..484faa053916038a8d2800d19843ae7c4c7eba8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-03  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/term/gfxterm.c: Add flag "functional" to skip input when
+       changing windows to avoid crash.
+
 2013-10-03  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/arm/cache.c: Add v5 write-through cache support.
index e7806b92ca02889b0fa682722f39825024896f0b..e7d5af4e8d29a4f905d8a98f4f34bcf79b2f3a35 100644 (file)
@@ -97,6 +97,8 @@ struct grub_virtual_screen
   struct grub_colored_char *text_buffer;
 
   int total_scroll;
+
+  int functional;
 };
 
 struct grub_gfxterm_window
@@ -178,6 +180,8 @@ clear_char (struct grub_colored_char *c)
 static void
 grub_virtual_screen_free (void)
 {
+  virtual_screen.functional = 0;
+
   /* If virtual screen has been allocated, free it.  */
   if (virtual_screen.text_buffer != 0)
     {
@@ -264,8 +268,12 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y,
       virtual_screen.text_buffer[i].code.ncomb = 0;
       clear_char (&(virtual_screen.text_buffer[i]));
     }
+  if (grub_errno)
+    return grub_errno;
 
-  return grub_errno;
+  virtual_screen.functional = 1;
+
+  return GRUB_ERR_NONE;
 }
 
 void
@@ -814,6 +822,9 @@ static void
 grub_gfxterm_putchar (struct grub_term_output *term,
                      const struct grub_unicode_glyph *c)
 {
+  if (!virtual_screen.functional)
+    return;
+
   if (c->base == '\a')
     /* FIXME */
     return;