From fb5ed3fffd1b4486cdcd1a0377ca8c747997df25 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 4 Jul 2022 23:37:19 +0600 Subject: [PATCH] qt: Don't resize non-existent monitors --- src/qt/qt_main.cpp | 1 + src/qt/qt_mainwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index f0f8f1547..198631d24 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -290,6 +290,7 @@ int main(int argc, char* argv[]) { { /* If needed, handle a screen resize. */ for (int i = 0; i < MONITORS_NUM; i++) { + if (!monitors[i].target_buffer) continue; if (!atomic_flag_test_and_set(&doresize_monitors[i]) && !video_fullscreen && !is_quit) { if (vid_resize & 2) plat_resize_monitor(fixed_size_x, fixed_size_y, i); diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index a22295058..2a0a561e9 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1617,7 +1617,7 @@ static void update_scaled_checkboxes(Ui::MainWindow* ui, QAction* selected) { device_force_redraw(); video_force_resize_set(1); for (int i = 0; i < MONITORS_NUM; i++) - atomic_flag_clear(&doresize_monitors[i]); + if (monitors[i].target_buffer) atomic_flag_clear(&doresize_monitors[i]); config_save(); }