0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. From 2abd6ada3fbd6a782346354b8fe47477463162fb Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Sun, 31 Oct 2021 03:47:05 +0000
  4. Subject: [PATCH 1/2] mitigate grub's missing characters for borders/arrow
  5. characters
  6. This cleans up the display on the main screen in GRUB.
  7. Just don't draw a border, at all.
  8. ---
  9. grub-core/normal/menu_text.c | 49 ++----------------------------------
  10. 1 file changed, 2 insertions(+), 47 deletions(-)
  11. diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
  12. index 18240e76c..4d6282b43 100644
  13. --- a/grub-core/normal/menu_text.c
  14. +++ b/grub-core/normal/menu_text.c
  15. @@ -108,47 +108,6 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right,
  16. grub_print_message_indented_real (msg, margin_left, margin_right, term, 0);
  17. }
  18. -static void
  19. -draw_border (struct grub_term_output *term, const struct grub_term_screen_geometry *geo)
  20. -{
  21. - int i;
  22. -
  23. - grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL);
  24. -
  25. - grub_term_gotoxy (term, (struct grub_term_coordinate) { geo->first_entry_x - 1,
  26. - geo->first_entry_y - 1 });
  27. - grub_putcode (GRUB_UNICODE_CORNER_UL, term);
  28. - for (i = 0; i < geo->entry_width + 1; i++)
  29. - grub_putcode (GRUB_UNICODE_HLINE, term);
  30. - grub_putcode (GRUB_UNICODE_CORNER_UR, term);
  31. -
  32. - for (i = 0; i < geo->num_entries; i++)
  33. - {
  34. - grub_term_gotoxy (term, (struct grub_term_coordinate) { geo->first_entry_x - 1,
  35. - geo->first_entry_y + i });
  36. - grub_putcode (GRUB_UNICODE_VLINE, term);
  37. - grub_term_gotoxy (term,
  38. - (struct grub_term_coordinate) { geo->first_entry_x + geo->entry_width + 1,
  39. - geo->first_entry_y + i });
  40. - grub_putcode (GRUB_UNICODE_VLINE, term);
  41. - }
  42. -
  43. - grub_term_gotoxy (term,
  44. - (struct grub_term_coordinate) { geo->first_entry_x - 1,
  45. - geo->first_entry_y - 1 + geo->num_entries + 1 });
  46. - grub_putcode (GRUB_UNICODE_CORNER_LL, term);
  47. - for (i = 0; i < geo->entry_width + 1; i++)
  48. - grub_putcode (GRUB_UNICODE_HLINE, term);
  49. - grub_putcode (GRUB_UNICODE_CORNER_LR, term);
  50. -
  51. - grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL);
  52. -
  53. - grub_term_gotoxy (term,
  54. - (struct grub_term_coordinate) { geo->first_entry_x - 1,
  55. - (geo->first_entry_y - 1 + geo->num_entries
  56. - + GRUB_TERM_MARGIN + 1) });
  57. -}
  58. -
  59. static int
  60. print_message (int nested, int edit, struct grub_term_output *term, int dry_run)
  61. {
  62. @@ -167,10 +126,8 @@ command-line or ESC to discard edits and return to the GRUB menu."),
  63. {
  64. char *msg_translated;
  65. - msg_translated = grub_xasprintf (_("Use the %C and %C keys to select which "
  66. - "entry is highlighted."),
  67. - GRUB_UNICODE_UPARROW,
  68. - GRUB_UNICODE_DOWNARROW);
  69. + msg_translated = grub_xasprintf (_("Use the arrow keys to select which "
  70. + "entry is highlighted."));
  71. if (!msg_translated)
  72. return 0;
  73. ret += grub_print_message_indented_real (msg_translated, STANDARD_MARGIN,
  74. @@ -410,8 +367,6 @@ grub_menu_init_page (int nested, int edit,
  75. grub_term_normal_color = grub_color_menu_normal;
  76. grub_term_highlight_color = grub_color_menu_highlight;
  77. - if (geo->border)
  78. - draw_border (term, geo);
  79. grub_term_normal_color = old_color_normal;
  80. grub_term_highlight_color = old_color_highlight;
  81. geo->timeout_y = geo->first_entry_y + geo->num_entries
  82. --
  83. 2.25.1