Use atomic_bool instead of atomic_flag for doresizes
atomic_flag seems to be broken on Windows for clearing them outside the thread they were tested and set in
This commit is contained in:
@@ -291,11 +291,12 @@ 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 (atomic_load(&doresize_monitors[i]) == 1 && !video_fullscreen && !is_quit) {
|
||||
if (vid_resize & 2)
|
||||
plat_resize_monitor(fixed_size_x, fixed_size_y, i);
|
||||
else
|
||||
plat_resize_monitor(monitors[i].mon_scrnsz_x, monitors[i].mon_scrnsz_y, i);
|
||||
atomic_store(&doresize_monitors[i], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1875,6 +1875,9 @@ void MainWindow::on_actionHiDPI_scaling_triggered()
|
||||
dpi_scale ^= 1;
|
||||
ui->actionHiDPI_scaling->setChecked(dpi_scale);
|
||||
emit resizeContents(monitors[0].mon_scrnsz_x, monitors[0].mon_scrnsz_y);
|
||||
for (int i = 1; i < MONITORS_NUM; i++) {
|
||||
if (renderers[i]) emit resizeContentsMonitor(monitors[i].mon_scrnsz_x, monitors[i].mon_scrnsz_y, i);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionHide_status_bar_triggered()
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
#include <86box/mouse.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/video.h>
|
||||
@@ -446,6 +447,7 @@ RendererStack::blitCommon(int x, int y, int w, int h)
|
||||
|
||||
void RendererStack::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
if (cpu_thread_run == 0 || is_quit == 0) { event->accept(); return; }
|
||||
event->ignore();
|
||||
main_window->close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user