MdeModulePkg: Sets the Cursor to selected BootOption.

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>
This commit is contained in:
Abdul Lateef Attar 2020-04-20 15:05:55 +08:00 committed by mergify[bot]
parent dafce295e6
commit 9b52b06f96
1 changed files with 11 additions and 11 deletions

View File

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