summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video/allegro_v.cpp3
-rw-r--r--src/video/cocoa/cocoa_v.mm4
-rw-r--r--src/video/sdl2_v.cpp3
-rw-r--r--src/video/sdl_v.cpp3
-rw-r--r--src/video/win32_v.cpp3
5 files changed, 11 insertions, 5 deletions
diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp
index 29db2f1da..83039fdc6 100644
--- a/src/video/allegro_v.cpp
+++ b/src/video/allegro_v.cpp
@@ -495,7 +495,8 @@ void VideoDriver_Allegro::MainLoop()
GameLoop();
}
- if (cur_ticks >= next_draw_tick) {
+ /* Prevent drawing when switching mode, as windows can be removed when they should still appear. */
+ if (cur_ticks >= next_draw_tick && (_switch_mode == SM_NONE || HasModalProgress())) {
next_draw_tick += this->GetDrawInterval();
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
if (next_draw_tick < cur_ticks - ALLOWED_DRIFT * this->GetDrawInterval()) next_draw_tick = cur_ticks;
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 31bad36dc..cf2512b04 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -36,6 +36,7 @@
#include "../../gfx_func.h"
#include "../../thread.h"
#include "../../core/random_func.hpp"
+#include "../../progress.h"
#include "../../settings_type.h"
#include "../../window_func.h"
#include "../../window_gui.h"
@@ -685,7 +686,8 @@ void VideoDriver_Cocoa::GameLoop()
::GameLoop();
}
- if (cur_ticks >= next_draw_tick) {
+ /* Prevent drawing when switching mode, as windows can be removed when they should still appear. */
+ if (cur_ticks >= next_draw_tick && (_switch_mode == SM_NONE || HasModalProgress())) {
next_draw_tick += this->GetDrawInterval();
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
if (next_draw_tick < cur_ticks - ALLOWED_DRIFT * this->GetDrawInterval()) next_draw_tick = cur_ticks;
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index 4170a953c..bdfdbdaf1 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -792,7 +792,8 @@ void VideoDriver_SDL::LoopOnce()
if (_draw_mutex != nullptr) draw_lock.lock();
}
- if (cur_ticks >= next_draw_tick) {
+ /* Prevent drawing when switching mode, as windows can be removed when they should still appear. */
+ if (cur_ticks >= next_draw_tick && (_switch_mode == SM_NONE || HasModalProgress())) {
next_draw_tick += this->GetDrawInterval();
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
if (next_draw_tick < cur_ticks - ALLOWED_DRIFT * this->GetDrawInterval()) next_draw_tick = cur_ticks;
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 0a603f979..7c75ebfea 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -745,7 +745,8 @@ void VideoDriver_SDL::MainLoop()
if (_draw_mutex != nullptr) draw_lock.lock();
}
- if (cur_ticks >= next_draw_tick) {
+ /* Prevent drawing when switching mode, as windows can be removed when they should still appear. */
+ if (cur_ticks >= next_draw_tick && (_switch_mode == SM_NONE || HasModalProgress())) {
next_draw_tick += this->GetDrawInterval();
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
if (next_draw_tick < cur_ticks - ALLOWED_DRIFT * this->GetDrawInterval()) next_draw_tick = cur_ticks;
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index a15071178..4ffbc9a21 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -1225,7 +1225,8 @@ void VideoDriver_Win32::MainLoop()
if (_draw_threaded) draw_lock.lock();
}
- if (cur_ticks >= next_draw_tick) {
+ /* Prevent drawing when switching mode, as windows can be removed when they should still appear. */
+ if (cur_ticks >= next_draw_tick && (_switch_mode == SM_NONE || HasModalProgress())) {
next_draw_tick += this->GetDrawInterval();
/* Avoid next_draw_tick getting behind more and more if it cannot keep up. */
if (next_draw_tick < cur_ticks - ALLOWED_DRIFT * this->GetDrawInterval()) next_draw_tick = cur_ticks;