From 74aa15644d177d0b16df075885fb5ef808d55105 Mon Sep 17 00:00:00 2001 From: andresdelcampo <33843515+andresdelcampo@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:53:45 +0200 Subject: [PATCH] Fix remember size and position regression in which vertical size could grow when reopening the VM (#6239) * Change window resizing logic when using 4:3 aspect ratio Change window resizing logic when using 4:3 aspect ratio to resize content only. Fixed issues in Remember size and position that are derived from the change. There is a slight flicker while resizing with force 4:3 aspect ratio. * Fix regression that adds vertical size when showing toolbar and statusbar and remembering size and po The recent rework on the force aspect 4:3 which needed to revisit the remembering of size and position introduced a regression that would save the size without considering the non-content window elements that could be showed or hidden. Now it calculates it accordingly. --- src/qt/qt_mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index fbc2d8a47..e88bedd90 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -936,8 +936,11 @@ MainWindow::closeEvent(QCloseEvent *event) const bool wasMax = isMaximized(); QRect normal = wasMax ? this->normalGeometry() : this->geometry(); // Save WINDOW size (not the content widget’s 4:3 box) + const int chromeHeight = geometry().height() - ui->stackedWidget->height(); window_w = normal.width(); - window_h = normal.height(); + window_h = normal.height() - chromeHeight; + if (window_h < 0) + window_h = 0; if (!QApplication::platformName().contains("wayland")) { window_x = normal.x(); window_y = normal.y();