From e3eb7467c6f7af80c6f6b47b4ea030552e07821b Mon Sep 17 00:00:00 2001 From: jchen20 Date: Wed, 26 Aug 2009 02:19:29 +0000 Subject: [PATCH] Fixed a bug on the menu display: Following steps to reproduce it: 1. Boot to shell 2. go to boot maint manager 3. Boot options 4. Add boot option 5. Add 15 or so unique boot options (just so the list scrolls) 6. go the boot maint manager 7. go to Boot options 8. go to Change boot order 9. the list is long enough that it scrolls when you push down once (to get to the commit option) 10. push down once and then up once (repeat) (from list selected to "commit" selected) 11. you will notice the list and text is getting corrupt 12. do it until all items in list are gone (system will assert) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9196 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/Ui.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c index 264bee6465..8b7344f42a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c @@ -2696,14 +2696,19 @@ UiDisplayMenu ( TopOfScreen = NewPos; } - Difference = MoveToNextStatement (TRUE, &NewPos); - if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) { + Difference = MoveToNextStatement (TRUE, &NewPos); + PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos); + DistanceValue += PreviousMenuOption->Skip; + + if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) { if (Difference > 0) { // // Previous focus MenuOption is above the TopOfScreen, so we need to scroll // TopOfScreen = NewPos; Repaint = TRUE; + SkipValue = 0; + OldSkipValue = 0; } } if (Difference < 0) { -- 2.39.2