=> 43ea78c6bbc304ab4ea8002dc356a09ff323c2cf
[1mdiff --git a/CMakeLists.txt b/CMakeLists.txt[m [1mindex a223c9c0..36c7e0ea 100644[m [1m--- a/CMakeLists.txt[m [1m+++ b/CMakeLists.txt[m [36m@@ -593,6 +593,11 @@[m [mif (ENABLE_TUI)[m target_link_libraries (tuiapp PUBLIC ${SEALCURSES_LDFLAGS})[m endif ()[m set_common_app_properties (tuiapp)[m [32m+[m[32m if (NOT ENABLE_IDLE_SLEEP)[m [32m+[m[32m # SEALCurses does not have a waiting event getter, so ease the CPU load by sleeping[m [32m+[m[32m # when nothing is happening.[m [32m+[m[32m target_compile_definitions (tuiapp LAGRANGE_ENABLE_IDLE_SLEEP=1)[m [32m+[m[32m endif ()[m endif ()[m [m # Deployment.[m [1mdiff --git a/src/app.c b/src/app.c[m [1mindex 21b1f803..8174524a 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -88,9 +88,6 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m #if defined (iPlatformMsys)[m # include "win32.h"[m #endif[m [31m-#if defined (iPlatformTerminal)[m [31m-# undef LAGRANGE_ENABLE_IDLE_SLEEP[m [31m-#endif[m #if defined (LAGRANGE_ENABLE_X11_XLIB)[m # include "x11.h"[m #endif[m [36m@@ -1463,6 +1460,9 @@[m [mstatic void init_App_(iApp *d, int argc, char **argv) {[m d->isIdling = iFalse;[m d->lastEventTime = 0;[m d->sleepTimer = SDL_AddTimer(1000, checkAsleep_App_, d);[m [32m+[m[32m#if defined (iPlatformTerminal)[m [32m+[m[32m d->idleSleepDelayMs = 1000 / 60;[m [32m+[m[32m#else[m SDL_DisplayMode dispMode;[m SDL_GetWindowDisplayMode(d->window->win, &dispMode);[m if (dispMode.refresh_rate) {[m [36m@@ -1471,6 +1471,7 @@[m [mstatic void init_App_(iApp *d, int argc, char **argv) {[m else {[m d->idleSleepDelayMs = 1000 / 60;[m }[m [32m+[m[32m#endif[m d->idleSleepDelayMs *= 0.9f;[m }[m #endif[m [36m@@ -1927,7 +1928,7 @@[m [mstatic iBool nextEvent_App_(iApp *d, enum iAppEventMode eventMode, SDL_Event *ev[m /* SDL regression circa 2.0.18? SDL_PollEvent() doesn't always return[m events posted immediately beforehand. Waiting with a very short timeout[m seems to work better. */[m [31m-#if defined (iPlatformLinux) && SDL_VERSION_ATLEAST(2, 0, 18)[m [32m+[m[32m#if !defined (iPlatformTerminal) && defined (iPlatformLinux) && SDL_VERSION_ATLEAST(2, 0, 18)[m return SDL_WaitEventTimeout(event, 1);[m #else[m return SDL_PollEvent(event);[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).