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
This commit is contained in:
Alexander Boettcher 2017-03-03 08:58:51 +01:00 committed by Christian Helmuth
parent e99eed3c8e
commit 0a1839e3e2
2 changed files with 19 additions and 26 deletions

View File

@ -156,27 +156,24 @@ void Console::onAdditionsStateChange()
void GenodeConsole::update_video_mode()
{
Display *d = getDisplay();
Guest *g = getGuest();
Genodefb *fb = dynamic_cast<Genodefb *>(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()

View File

@ -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<Genodefb *>(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()