]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Sets the Cursor to selected BootOption.
authorAbdul Lateef Attar <abdul@marvell.com>
Mon, 20 Apr 2020 07:05:55 +0000 (15:05 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 10 Jun 2020 03:26:43 +0000 (03:26 +0000)
Its been observed that in MenuManagerMenuApp when user
selects a different BootOption using Up/Down key, the
current Cursor position is not chaning.
Still points to the old BootOption.

This changes first dispalys/redraws the old BootOption
followed by new BootOption. Doing so will make current
cursor pointing to the user selected BootOption.

Signed-off-by: Abdul Lateef Attar <abdul@marvell.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c

index 34d4089a553a57306e8396c7ba49a42d406cd18f..9e729074ece8152d86f3cd5008a4ddf745879637 100644 (file)
@@ -450,21 +450,11 @@ BootMenuSelectItem (
     RePaintItems = TRUE;\r
   }\r
 \r
-  //\r
-  // Print want to select item\r
-  //\r
-  FirstItem = BootMenuData->ScrollBarControl.FirstItem;\r
-  gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLACK);\r
-  String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[WantSelectItem], NULL);\r
-  PrintCol = StartCol  + 1;\r
-  PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + WantSelectItem - FirstItem;\r
-  PrintStringAt (PrintCol, PrintRow, String);\r
-  FreePool (String);\r
-\r
   //\r
   // if Want Select and selected item isn't the same and doesn't re-draw selectable\r
   // items, clear select item\r
   //\r
+  FirstItem = BootMenuData->ScrollBarControl.FirstItem;\r
   if (WantSelectItem != BootMenuData->SelectItem && !RePaintItems) {\r
     gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);\r
     String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[BootMenuData->SelectItem], NULL);\r
@@ -474,6 +464,16 @@ BootMenuSelectItem (
     FreePool (String);\r
   }\r
 \r
+  //\r
+  // Print want to select item\r
+  //\r
+  gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLACK);\r
+  String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[WantSelectItem], NULL);\r
+  PrintCol = StartCol  + 1;\r
+  PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + WantSelectItem - FirstItem;\r
+  PrintStringAt (PrintCol, PrintRow, String);\r
+  FreePool (String);\r
+\r
   gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);\r
   BootMenuData->SelectItem = WantSelectItem;\r
   return EFI_SUCCESS;\r