qt: Don't resize non-existent monitors

This commit is contained in:
Cacodemon345
2022-07-04 23:37:19 +06:00
parent e8ffc699ba
commit fb5ed3fffd
2 changed files with 2 additions and 1 deletions

View File

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

View File

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