提交 ac4dd020 编写于 作者: V vit9696

OpenCanopy: Fix switching to graphics mode when entering canopy

closes acidanthera/bugtracker#1512
上级 12f15107
...@@ -10,6 +10,7 @@ OpenCore Changelog ...@@ -10,6 +10,7 @@ OpenCore Changelog
- Added workaround for firmware not specifying DeviceHandle at bootstrap - Added workaround for firmware not specifying DeviceHandle at bootstrap
- Added support for R/O page tables in `SetupVirtualMap` quirk - Added support for R/O page tables in `SetupVirtualMap` quirk
- Added OEM preservation for certain Apple SMBIOS tables - Added OEM preservation for certain Apple SMBIOS tables
- Fixed switching to graphics mode when entering OpenCanopy
#### v0.6.6 #### v0.6.6
- Added keyboard and pointer entry scroll support in OpenCanopy - Added keyboard and pointer entry scroll support in OpenCanopy
......
...@@ -33,9 +33,48 @@ ...@@ -33,9 +33,48 @@
extern BOOT_PICKER_GUI_CONTEXT mGuiContext; extern BOOT_PICKER_GUI_CONTEXT mGuiContext;
extern CONST GUI_IMAGE mBackgroundImage; extern CONST GUI_IMAGE mBackgroundImage;
STATIC GUI_DRAWING_CONTEXT mDrawContext;
STATIC EFI_CONSOLE_CONTROL_SCREEN_MODE mPreviousMode;
STATIC
EFI_STATUS
OcShowMenyByOcEnter (
IN OC_BOOT_CONTEXT *BootContext
)
{
EFI_STATUS Status;
Status = GuiLibConstruct (
BootContext->PickerContext,
mGuiContext.CursorDefaultX,
mGuiContext.CursorDefaultY
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Extension for OpenCore builtin renderer to mark that we control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_CONTROLLED);
mPreviousMode = OcConsoleControlSetMode (EfiConsoleControlScreenGraphics);
return EFI_SUCCESS;
}
STATIC STATIC
GUI_DRAWING_CONTEXT VOID
mDrawContext; OcShowMenyByOcLeave (
VOID
)
{
GuiLibDestruct ();
//
// Extension for OpenCore builtin renderer to mark that we no longer control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_UNCONTROLLED);
OcConsoleControlSetMode (mPreviousMode);
}
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
...@@ -56,20 +95,11 @@ OcShowMenuByOc ( ...@@ -56,20 +95,11 @@ OcShowMenuByOc (
mGuiContext.PickerContext = BootContext->PickerContext; mGuiContext.PickerContext = BootContext->PickerContext;
mGuiContext.AudioPlaybackTimeout = -1; mGuiContext.AudioPlaybackTimeout = -1;
Status = GuiLibConstruct ( Status = OcShowMenyByOcEnter (BootContext);
BootContext->PickerContext,
mGuiContext.CursorDefaultX,
mGuiContext.CursorDefaultY
);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
//
// Extension for OpenCore builtin renderer to mark that we control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_CONTROLLED);
// //
// Do not play intro animation for blind. // Do not play intro animation for blind.
// //
...@@ -83,7 +113,7 @@ OcShowMenuByOc ( ...@@ -83,7 +113,7 @@ OcShowMenuByOc (
InternalGetCursorImage InternalGetCursorImage
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
GuiLibDestruct (); OcShowMenyByOcLeave ();
return Status; return Status;
} }
...@@ -95,7 +125,7 @@ OcShowMenuByOc ( ...@@ -95,7 +125,7 @@ OcShowMenuByOc (
Index == BootContext->DefaultEntry->EntryIndex - 1 Index == BootContext->DefaultEntry->EntryIndex - 1
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
GuiLibDestruct (); OcShowMenyByOcLeave ();
return Status; return Status;
} }
} }
...@@ -138,12 +168,7 @@ OcShowMenuByOc ( ...@@ -138,12 +168,7 @@ OcShowMenuByOc (
// //
GuiClearScreen (&mDrawContext, mBackgroundImage.Buffer); GuiClearScreen (&mDrawContext, mBackgroundImage.Buffer);
BootPickerViewDeinitialize (&mDrawContext, &mGuiContext); BootPickerViewDeinitialize (&mDrawContext, &mGuiContext);
GuiLibDestruct (); OcShowMenyByOcLeave ();
//
// Extension for OpenCore builtin renderer to mark that we no longer control text output here.
//
gST->ConOut->TestString (gST->ConOut, OC_CONSOLE_MARK_UNCONTROLLED);
*ChosenBootEntry = mGuiContext.BootEntry; *ChosenBootEntry = mGuiContext.BootEntry;
BootContext->PickerContext->HideAuxiliary = mGuiContext.HideAuxiliary; BootContext->PickerContext->HideAuxiliary = mGuiContext.HideAuxiliary;
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
MtrrLib MtrrLib
OcAppleKeyMapLib OcAppleKeyMapLib
OcCompressionLib OcCompressionLib
OcConsoleLib
OcGuardLib OcGuardLib
OcMiscLib OcMiscLib
OcPngLib OcPngLib
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册