From d38f972c8cb958524b326986c6dc72b24fa35dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 4 Apr 2020 10:53:14 +0700 Subject: [PATCH] utils: adjust to change in vte3>0.59.0 vte3 has changed the parameter to Terminal::feed_child from char[] to uint8[] --- CMakeLists.txt | 4 ++++ lib/utils.vala | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3cea091..458ea4ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ option(USE_VENDOR_LIB "Backport support for debian stretch" ON) if (NOT USE_VENDOR_LIB) pkg_check_modules(VTE REQUIRED vte-2.91) +# There're 3 releases for 0.59.x, only 0.59.0 keeps old behaviour +if("${VTE_VERSION}" VERSION_GREATER "0.59.0") + list(APPEND ARGS_DEFINITIONS "VTE_0_60") +endif() endif() if (NOT DEFINED VERSION) diff --git a/lib/utils.vala b/lib/utils.vala index 9f3c36e8..3241d5ce 100644 --- a/lib/utils.vala +++ b/lib/utils.vala @@ -607,7 +607,13 @@ namespace Utils { return command; } +#if VTE_0_60 + public uint8[] to_raw_data(string str) { + return str.data; + } +#else public char[] to_raw_data(string str) { return str.to_utf8(); } +#endif }