diff --git a/Changelog.md b/Changelog.md index 8cf61f9468d476069635d6d72e2f12255b3dca59..b0165a69450ac9d83a37f199e5892ab94d967460 100644 --- a/Changelog.md +++ b/Changelog.md @@ -46,6 +46,7 @@ OpenCore Changelog - Added additional support for configuring correct key repeat behaviour with KeySupport mode - Fixed CPU multiplier detection on pre-Nehalem Intel CPUs - Fixed incorrect handling of multiple processors and processor cache in SMBIOS +- Matched default Apple boot picker cursor start position #### v0.6.7 - Fixed ocvalidate return code to be non-zero when issues are found diff --git a/Platform/OpenCanopy/OcBootstrap.c b/Platform/OpenCanopy/OcBootstrap.c index 420d553293d1f98e48f31962d8ef0be3ba9f9008..27012e6810adcab6ab55bdd424b60564ed2737d9 100644 --- a/Platform/OpenCanopy/OcBootstrap.c +++ b/Platform/OpenCanopy/OcBootstrap.c @@ -30,6 +30,11 @@ #include "BmfLib.h" #include "GuiApp.h" +// +// Add slight x offset of cursor by its position within its icon file, +// in order to match look of Apple picker initial position. +// +#define DEFAULT_CURSOR_OFFSET_X BOOT_CURSOR_OFFSET #define DEFAULT_CURSOR_OFFSET_Y 112U extern BOOT_PICKER_GUI_CONTEXT mGuiContext; @@ -77,6 +82,21 @@ OcShowMenuByOcLeave ( OcConsoleControlSetMode (mPreviousMode); } +STATIC +VOID +OcSetInitialCursorOffset ( + VOID + ) +{ + // + // The cursor position is updated on GUI exit, so don't overwrite it. + // + if (mGuiContext.PickerContext == NULL) { + mGuiContext.CursorOffsetX = DEFAULT_CURSOR_OFFSET_X * mGuiContext.Scale; + mGuiContext.CursorOffsetY = DEFAULT_CURSOR_OFFSET_Y * mGuiContext.Scale; + } +} + EFI_STATUS EFIAPI OcShowMenuByOc ( @@ -89,13 +109,7 @@ OcShowMenuByOc ( UINTN Index; *ChosenBootEntry = NULL; - // - // The cursor position is updated on GUI exit, so don't overwrite it. - // - if (mGuiContext.PickerContext == NULL) { - mGuiContext.CursorOffsetX = 0; - mGuiContext.CursorOffsetY = DEFAULT_CURSOR_OFFSET_Y * mGuiContext.Scale; - } + OcSetInitialCursorOffset(); mGuiContext.BootEntry = NULL; mGuiContext.ReadyToBoot = FALSE; mGuiContext.HideAuxiliary = BootContext->PickerContext->HideAuxiliary; @@ -207,13 +221,7 @@ OcShowPasswordByOc ( ) { EFI_STATUS Status; - // - // The cursor position is updated on GUI exit, so don't overwrite it. - // - if (mGuiContext.PickerContext == NULL) { - mGuiContext.CursorOffsetX = 0; - mGuiContext.CursorOffsetY = DEFAULT_CURSOR_OFFSET_Y * mGuiContext.Scale; - } + OcSetInitialCursorOffset (); mGuiContext.BootEntry = NULL; mGuiContext.ReadyToBoot = FALSE; mGuiContext.HideAuxiliary = TRUE;