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.
This commit is contained in:
andresdelcampo
2025-09-27 19:53:45 +02:00
committed by GitHub
parent 58b4af4689
commit 74aa15644d

View File

@@ -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 widgets 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();