vbox6: restore initial window size of 1024x768

This commit is contained in:
Christian Helmuth 2024-10-25 16:07:43 +02:00
parent 45fc49b4f1
commit f94e0a3464
2 changed files with 10 additions and 12 deletions

View File

@ -39,7 +39,7 @@ class Genodefb :
* The mode currently used by the VM. Can be smaller than the * The mode currently used by the VM. Can be smaller than the
* framebuffer mode. * framebuffer mode.
*/ */
Gui::Area _virtual_fb_mode; Gui::Area _virtual_fb_area;
void *_attach() void *_attach()
{ {
@ -62,10 +62,10 @@ class Genodefb :
{ {
if (!_fb_base) return; if (!_fb_base) return;
size_t const max_h = Genode::min(_gui_win.area.h, _virtual_fb_mode.h); size_t const max_h = Genode::min(_gui_win.area.h, _virtual_fb_area.h);
size_t const num_pixels = _gui_win.area.w * max_h; size_t const num_pixels = _gui_win.area.w * max_h;
memset(_fb_base, 0, num_pixels * sizeof(Genode::Pixel_rgb888)); memset(_fb_base, 0, num_pixels * sizeof(Genode::Pixel_rgb888));
_gui.framebuffer.refresh({ _gui_win.at, _virtual_fb_mode }); _gui.framebuffer.refresh({ _gui_win.at, _virtual_fb_area });
} }
void _adjust_buffer() void _adjust_buffer()
@ -89,7 +89,7 @@ class Genodefb :
: :
_env(env), _env(env),
_gui(gui), _gui(gui),
_virtual_fb_mode(_initial_setup()), _virtual_fb_area(_initial_setup()),
_display(display) _display(display)
{ {
int rc = RTCritSectInit(&_fb_lock); int rc = RTCritSectInit(&_fb_lock);
@ -140,12 +140,12 @@ class Genodefb :
bool const ok = (w <= (ULONG)_gui_win.area.w) && bool const ok = (w <= (ULONG)_gui_win.area.w) &&
(h <= (ULONG)_gui_win.area.h); (h <= (ULONG)_gui_win.area.h);
bool const changed = (w != (ULONG)_virtual_fb_mode.w) || bool const changed = (w != (ULONG)_virtual_fb_area.w) ||
(h != (ULONG)_virtual_fb_mode.h); (h != (ULONG)_virtual_fb_area.h);
if (ok && changed) { if (ok && changed) {
Genode::log("fb resize : [", screen, "] ", Genode::log("fb resize : [", screen, "] ",
_virtual_fb_mode, " -> ", _virtual_fb_area, " -> ",
w, "x", h, w, "x", h,
" (host: ", _gui_win.area, ")"); " (host: ", _gui_win.area, ")");
@ -155,12 +155,12 @@ class Genodefb :
_clear_screen(); _clear_screen();
} }
_virtual_fb_mode = { w, h }; _virtual_fb_area = { w, h };
result = S_OK; result = S_OK;
} else if (changed) { } else if (changed) {
Genode::log("fb resize : [", screen, "] ", Genode::log("fb resize : [", screen, "] ",
_virtual_fb_mode, " -> ", _virtual_fb_area, " -> ",
w, "x", h, " ignored" w, "x", h, " ignored"
" (host: ", _gui_win.area, ")"); " (host: ", _gui_win.area, ")");
} }

View File

@ -440,9 +440,7 @@ void Main::_handle_fb_mode()
Gui::Rect const gui_win = gui.window().convert<Gui::Rect>( Gui::Rect const gui_win = gui.window().convert<Gui::Rect>(
[&] (Gui::Rect rect) { return rect; }, [&] (Gui::Rect rect) { return rect; },
[&] (Gui::Undefined) { return gui.panorama().convert<Gui::Rect>( [&] (Gui::Undefined) { return Gui::Rect { { }, { 1024, 768 } }; });
[&] (Gui::Rect rect) { return rect; },
[&] (Gui::Undefined) { return Gui::Rect { { }, { 800, 600 } }; }); });
fb->update_mode(gui_win); fb->update_mode(gui_win);