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()