diff --git a/WinPort/src/Backend/TTY/TTYBackend.cpp b/WinPort/src/Backend/TTY/TTYBackend.cpp index 7ddd30257..b00475219 100644 --- a/WinPort/src/Backend/TTY/TTYBackend.cpp +++ b/WinPort/src/Backend/TTY/TTYBackend.cpp @@ -222,7 +222,12 @@ void TTYBackend::ReaderThread() } else { if (!strchr(_nodetect, 'x') || strstr(_nodetect, "xi")) { - _ttyx = StartTTYX(_full_exe_path, !strstr(_nodetect, "xi")); + + // disable xi on Wayland as it not work there anyway and also causes delays + const char *xdg_st = getenv("XDG_SESSION_TYPE"); + bool on_wayland = (xdg_st && strcasecmp(xdg_st, "wayland") == 0); + + _ttyx = StartTTYX(_full_exe_path, !strstr(_nodetect, "xi") && !on_wayland); } if (_ttyx) { if (!_ext_clipboard) { @@ -295,6 +300,12 @@ void TTYBackend::ReaderLoop() int rs; + // Enable esc expiration on Wayland as Xi not work there + const char *xdg_st = getenv("XDG_SESSION_TYPE"); + if ((xdg_st && strcasecmp(xdg_st, "wayland") == 0) && !_esc_expiration) { + _esc_expiration = 100; + } + if (!idle_expired && _esc_expiration > 0 && !_far2l_tty) { struct timeval tv; tv.tv_sec = _esc_expiration / 1000;