summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2024-03-13 15:14:43 +0100
committerBenBE <BenBE@geshi.org>2024-03-14 20:34:47 +0100
commit05c7d4fc204e8e6aa3e0e302833f187547ef18bc (patch)
tree2a7d69a1a5480f500072b1875caa2cbcdc793005
parent53bd369be760aaeb5e28cb965e9edcfb3f232d92 (diff)
Ignore FOCUS_IN and FOCUS_OUT events if these have been activated within xterm
Closes: #1410
-rw-r--r--CRT.c2
-rw-r--r--CRT.h2
-rw-r--r--ScreenManager.c3
3 files changed, 7 insertions, 0 deletions
diff --git a/CRT.c b/CRT.c
index 6f748148..7912b203 100644
--- a/CRT.c
+++ b/CRT.c
@@ -1036,6 +1036,8 @@ IGNORE_WCASTQUAL_BEGIN
sequence[1] = c;
define_key(sequence, KEY_ALT('A' + (c - 'a')));
}
+ define_key("\033[I", KEY_FOCUS_IN);
+ define_key("\033[O", KEY_FOCUS_OUT);
#ifdef HTOP_NETBSD
IGNORE_WCASTQUAL_END
#undef define_key
diff --git a/CRT.h b/CRT.h
index 58097986..8740e096 100644
--- a/CRT.h
+++ b/CRT.h
@@ -168,6 +168,8 @@ void CRT_handleSIGSEGV(int signal) ATTR_NORETURN;
#define KEY_RECLICK KEY_F(32)
#define KEY_SHIFT_TAB KEY_F(33)
#define KEY_ALT(x) (KEY_F(64 - 26) + ((x) - 'A'))
+#define KEY_FOCUS_IN (KEY_MAX + 'I')
+#define KEY_FOCUS_OUT (KEY_MAX + 'O')
extern const char* CRT_degreeSign;
diff --git a/ScreenManager.c b/ScreenManager.c
index e7e82e1d..6f3b0598 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -363,6 +363,9 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, con
ScreenManager_resize(this);
continue;
}
+ case KEY_FOCUS_IN:
+ case KEY_FOCUS_OUT:
+ break;
case KEY_LEFT:
case KEY_CTRL('B'):
if (this->panelCount < 2) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy