Skip to content

Commit

Permalink
Merge pull request #1 from ARPGLTD/KeepCallingMainIterationDuringLive…
Browse files Browse the repository at this point in the history
…Resizing

Keep calling Main::iteration() during live resizing
  • Loading branch information
migueldeicaza authored Dec 2, 2023
2 parents 3a197cb + 8b2c438 commit 3acdad3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions platform/macos/os_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,15 @@
// Do not redraw when rendering is done from the separate thread, it will conflict with the OpenGL context updates.

DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
if (get_singleton()->get_main_loop() && ds && (get_singleton()->get_render_thread_mode() != RENDER_SEPARATE_THREAD) && !ds->get_is_resizing()) {
Main::force_redraw();
if (get_singleton()->get_main_loop() && ds && (get_singleton()->get_render_thread_mode() != RENDER_SEPARATE_THREAD)) {
if (!ds->get_is_resizing()) {
// Don't force redraws during resize.
// -[GodotContentLayerDelegate displayLayer:] forces redraws during resizing, and
// also calls Main::iteration(), but only when the window is actively resized. If
// the mouse is still held down, but not moving, the game stalls.

Main::force_redraw();
}
if (!Main::is_iterating()) { // Avoid cyclic loop.
Main::iteration();
}
Expand Down

0 comments on commit 3acdad3

Please sign in to comment.