From 18e3fd5ce79a10aa401bef9575a6c6de8e547d31 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sun, 4 Jul 2021 16:50:41 +0200 Subject: [PATCH] Check for set_escdelay in ncurses --- InfoScreen.c | 2 ++ ScreenManager.c | 4 ++++ configure.ac | 1 + 3 files changed, 7 insertions(+) diff --git a/InfoScreen.c b/InfoScreen.c index 8f575232..259ecee3 100644 --- a/InfoScreen.c +++ b/InfoScreen.c @@ -94,7 +94,9 @@ void InfoScreen_run(InfoScreen* this) { if (this->inc->active) { (void) move(LINES - 1, CRT_cursorX); } +#ifdef HAVE_SET_ESCDELAY set_escdelay(25); +#endif int ch = getch(); if (ch == ERR) { diff --git a/ScreenManager.c b/ScreenManager.c index 6e7551fe..8ec60119 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "ScreenManager.h" #include @@ -164,7 +166,9 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { } int prevCh = ch; +#ifdef HAVE_SET_ESCDELAY set_escdelay(25); +#endif ch = getch(); HandlerResult result = IGNORED; diff --git a/configure.ac b/configure.ac index ec2222d7..8431242f 100644 --- a/configure.ac +++ b/configure.ac @@ -336,6 +336,7 @@ if test "$my_htop_platform" = "solaris"; then # Since ncruses macros use the ERR macro, we can not use another name. AC_DEFINE([ERR], [(-1)], [Predefine ncurses macro.]) fi +AC_CHECK_FUNCS( [set_escdelay] ) AC_ARG_ENABLE([hwloc],