From 40ed3118950fd41b5032da067f2e31fdfa266995 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 8 Oct 2025 21:19:23 +0600 Subject: [PATCH] Resize renderer view back on Windows on language selection changes (#6302) --- src/qt/qt_mainwindow.cpp | 7 +++++++ src/qt/qt_progsettings.cpp | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 80bbd1d0a..45ec2e95b 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -2306,7 +2306,14 @@ MainWindow::changeEvent(QEvent *event) { #ifdef Q_OS_WINDOWS if (event->type() == QEvent::LanguageChange) { + auto size = this->centralWidget()->size(); QApplication::setFont(QFont(ProgSettings::getFontName(lang_id), 9)); + QApplication::processEvents(); + main_window->centralWidget()->setFixedSize(size); + QApplication::processEvents(); + if (vid_resize == 1) { + main_window->centralWidget()->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + } } #endif QWidget::changeEvent(event); diff --git a/src/qt/qt_progsettings.cpp b/src/qt/qt_progsettings.cpp index e979a22b6..ac1d6478f 100644 --- a/src/qt/qt_progsettings.cpp +++ b/src/qt/qt_progsettings.cpp @@ -20,6 +20,7 @@ #include "ui_qt_mainwindow.h" #include "qt_machinestatus.hpp" +#include #include #include #include @@ -36,6 +37,7 @@ extern "C" { #include <86box/plat.h> #include <86box/mem.h> #include <86box/rom.h> +#include <86box/video.h> } extern MainWindow *main_window; @@ -107,6 +109,7 @@ ProgSettings::ProgSettings(QWidget *parent) void ProgSettings::accept() { + auto size = main_window->centralWidget()->size(); lang_id = ui->comboBoxLanguage->currentData().toInt(); open_dir_usr_path = ui->openDirUsrPath->isChecked() ? 1 : 0; confirm_exit = ui->checkBoxConfirmExit->isChecked() ? 1 : 0; @@ -137,6 +140,13 @@ ProgSettings::accept() connect(main_window, &MainWindow::statusBarMessage, main_window->status.get(), &MachineStatus::message, Qt::QueuedConnection); mouse_sensitivity = mouseSensitivity; config_save_global(); + QTimer::singleShot(200, [size] () { + main_window->centralWidget()->setFixedSize(size); + QApplication::processEvents(); + if (vid_resize == 1) { + main_window->centralWidget()->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + } + }); QDialog::accept(); }