From 0a1839e3e230f360e9154c0fda08ed52c7080adf Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 3 Mar 2017 08:58:51 +0100 Subject: [PATCH] vbox: ever set hint about host graphic resolution Otherwise it may happend that the Guest tries to set the last stored resolution from another run, which maybe is too large. Up to now, everthing is fine, beside the fact that output changes are not visible - which is odd and one things the VM came not up. Issue #2306 --- .../ports/src/virtualbox/frontend/console.cc | 23 ++++++++----------- .../ports/src/virtualbox5/frontend/console.cc | 22 ++++++++---------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc index 7fdc81357..6b4772e13 100644 --- a/repos/ports/src/virtualbox/frontend/console.cc +++ b/repos/ports/src/virtualbox/frontend/console.cc @@ -156,27 +156,24 @@ void Console::onAdditionsStateChange() void GenodeConsole::update_video_mode() { Display *d = getDisplay(); - Guest *g = getGuest(); Genodefb *fb = dynamic_cast(d->getFramebuffer()); - LONG64 ignored = 0; - if (fb && (fb->w() == 0) && (fb->h() == 0)) { + if (!fb) + return; + + if ((fb->w() == 0) && (fb->h() == 0)) { /* interpret a size of 0x0 as indication to quit VirtualBox */ if (PowerButton() != S_OK) Genode::error("ACPI shutdown failed"); return; } - AdditionsFacilityType_T is_graphics; - g->GetFacilityStatus(AdditionsFacilityType_Graphics, &ignored, &is_graphics); - - if (fb && is_graphics) - d->SetVideoModeHint(0 /*=display*/, - true /*=enabled*/, false /*=changeOrigin*/, - 0 /*=originX*/, 0 /*=originY*/, - fb->w(), fb->h(), - /* Windows 8 only accepts 32-bpp modes */ - 32); + d->SetVideoModeHint(0 /*=display*/, + true /*=enabled*/, false /*=changeOrigin*/, + 0 /*=originX*/, 0 /*=originY*/, + fb->w(), fb->h(), + /* Windows 8 only accepts 32-bpp modes */ + 32); } void GenodeConsole::handle_input() diff --git a/repos/ports/src/virtualbox5/frontend/console.cc b/repos/ports/src/virtualbox5/frontend/console.cc index 215572b48..dfd916591 100644 --- a/repos/ports/src/virtualbox5/frontend/console.cc +++ b/repos/ports/src/virtualbox5/frontend/console.cc @@ -95,7 +95,6 @@ void Console::i_onAdditionsStateChange() void GenodeConsole::update_video_mode() { Display *d = i_getDisplay(); - Guest *g = i_getGuest(); IFramebuffer *pFramebuffer = NULL; HRESULT rc = d->QueryFramebuffer(0, &pFramebuffer); @@ -103,25 +102,22 @@ void GenodeConsole::update_video_mode() Genodefb *fb = dynamic_cast(pFramebuffer); - LONG64 ignored = 0; + if (!fb) + return; - if (fb && (fb->w() == 0) && (fb->h() == 0)) { + if ((fb->w() == 0) && (fb->h() == 0)) { /* interpret a size of 0x0 as indication to quit VirtualBox */ if (PowerButton() != S_OK) Genode::error("ACPI shutdown failed"); return; } - AdditionsFacilityType_T is_graphics; - g->GetFacilityStatus(AdditionsFacilityType_Graphics, &ignored, &is_graphics); - - if (fb && is_graphics) - d->SetVideoModeHint(0 /*=display*/, - true /*=enabled*/, false /*=changeOrigin*/, - 0 /*=originX*/, 0 /*=originY*/, - fb->w(), fb->h(), - /* Windows 8 only accepts 32-bpp modes */ - 32); + d->SetVideoModeHint(0 /*=display*/, + true /*=enabled*/, false /*=changeOrigin*/, + 0 /*=originX*/, 0 /*=originY*/, + fb->w(), fb->h(), + /* Windows 8 only accepts 32-bpp modes */ + 32); } void GenodeConsole::handle_input()