From a2bb96723acb3ee8c85e69eff8fd173541276e0a Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Wed, 28 Oct 2015 16:14:14 +0100 Subject: [PATCH] vbox: respond to zero-resized framebuffer --- repos/ports/ports/virtualbox.hash | 2 +- .../ports/src/virtualbox/frontend/console.cc | 8 ++++- .../src/virtualbox/patches/powerbutton.patch | 32 +++++++++++++++++++ repos/ports/src/virtualbox/patches/series | 1 + 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 repos/ports/src/virtualbox/patches/powerbutton.patch diff --git a/repos/ports/ports/virtualbox.hash b/repos/ports/ports/virtualbox.hash index b31dd355d..a5610f8b4 100644 --- a/repos/ports/ports/virtualbox.hash +++ b/repos/ports/ports/virtualbox.hash @@ -1 +1 @@ -d0f14330729a8ef3234c8a569e183e230c28e100 +794a16b709f2e4c34e27cc7f9bf15711c6d9e450 diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc index 75a68b6c4..008bb52a6 100644 --- a/repos/ports/src/virtualbox/frontend/console.cc +++ b/repos/ports/src/virtualbox/frontend/console.cc @@ -81,7 +81,6 @@ STDMETHODIMP Console::COMSETTER(UseHostClipboard)(BOOL aUseHostClipboard) HRESULT Console::Reset() DUMMY(E_FAIL) HRESULT Console::Pause() DUMMY(E_FAIL) HRESULT Console::Resume() DUMMY(E_FAIL) -HRESULT Console::PowerButton() DUMMY(E_FAIL) HRESULT Console::SleepButton() DUMMY(E_FAIL) HRESULT Console::GetPowerButtonHandled(bool*) DUMMY(E_FAIL) HRESULT Console::GetGuestEnteredACPIMode(bool*) DUMMY(E_FAIL) @@ -160,6 +159,13 @@ void GenodeConsole::update_video_mode() Genodefb *fb = dynamic_cast(d->getFramebuffer()); LONG64 ignored = 0; + if (fb && (fb->w() == 0) && (fb->h() == 0)) { + /* interpret a size of 0x0 as indication to quit VirtualBox */ + if (PowerButton() != S_OK) + PERR("ACPI shutdown failed"); + return; + } + AdditionsFacilityType_T is_graphics; g->GetFacilityStatus(AdditionsFacilityType_Graphics, &ignored, &is_graphics); diff --git a/repos/ports/src/virtualbox/patches/powerbutton.patch b/repos/ports/src/virtualbox/patches/powerbutton.patch new file mode 100644 index 000000000..f793db8ac --- /dev/null +++ b/repos/ports/src/virtualbox/patches/powerbutton.patch @@ -0,0 +1,32 @@ +powerbutton.patch + +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp +index b0b04ad..3680be4 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp +@@ -106,7 +106,9 @@ + #if 0 + #include + #include ++#endif + #include ++#if 0 + #include + #include + #endif +@@ -2625,6 +2627,7 @@ STDMETHODIMP Console::Resume() + LogFlowThisFuncLeave(); + return rc; + } ++#endif + + STDMETHODIMP Console::PowerButton() + { +@@ -2671,6 +2674,7 @@ STDMETHODIMP Console::PowerButton() + return rc; + } + ++#if 0 + STDMETHODIMP Console::GetPowerButtonHandled(BOOL *aHandled) + { + LogFlowThisFuncEnter(); diff --git a/repos/ports/src/virtualbox/patches/series b/repos/ports/src/virtualbox/patches/series index 5523f9407..3e55b211f 100644 --- a/repos/ports/src/virtualbox/patches/series +++ b/repos/ports/src/virtualbox/patches/series @@ -23,3 +23,4 @@ usb.patch tm_smp.patch posix.patch hostservice.patch +powerbutton.patch