From 8a4b52d9e3bd6214ca6da128323b8f5f48d62014 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Thu, 22 Apr 2021 19:07:46 +0200 Subject: [PATCH] vbox: only clear screen if virtual_fb_mode changed Fixes genodelabs/genode#4085 --- repos/ports/src/virtualbox5/frontend/fb.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/repos/ports/src/virtualbox5/frontend/fb.h b/repos/ports/src/virtualbox5/frontend/fb.h index 302c826010..0fb64f3153 100644 --- a/repos/ports/src/virtualbox5/frontend/fb.h +++ b/repos/ports/src/virtualbox5/frontend/fb.h @@ -145,10 +145,13 @@ class Genodefb : /* save the new bitmap reference */ _display->QuerySourceBitmap(screen, _display_bitmap.asOutParam()); - bool ok = (w <= (ULONG)_fb_mode.area.w()) && - (h <= (ULONG)_fb_mode.area.h()); + bool const ok = (w <= (ULONG)_fb_mode.area.w()) && + (h <= (ULONG)_fb_mode.area.h()); - if (ok) { + bool const changed = (w != (ULONG)_virtual_fb_mode.area.w()) || + (h != (ULONG)_virtual_fb_mode.area.h()); + + if (ok && changed) { Genode::log("fb resize : [", screen, "] ", _virtual_fb_mode.area, " -> ", w, "x", h, @@ -163,7 +166,7 @@ class Genodefb : _virtual_fb_mode = Fb_Genode::Mode { .area = { w, h } }; result = S_OK; - } else { + } else if (changed) { Genode::log("fb resize : [", screen, "] ", _virtual_fb_mode.area, " -> ", w, "x", h, " ignored"