From d39c35e59e6e541cf1f8e2479c77203f6214e5e6 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Tue, 29 Jun 2021 05:10:33 +0200
Subject: Enable focus tracking opportunistically
---
LICENSE | 2 +-
driver-ti.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/LICENSE b/LICENSE
index 25a4cdb..b10ce3f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
Copyright (c) 2007-2014 Paul Evans
+Copyright (c) 2014-2021 Přemysl Eric Janouch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/driver-ti.c b/driver-ti.c
index 6dbdfc1..00c9ad8 100644
--- a/driver-ti.c
+++ b/driver-ti.c
@@ -364,6 +364,8 @@ mouse_reset (termo_ti_t *ti)
&& write_string (ti->tk, "\x1b[?1002l")
&& write_string (ti->tk, "\x1b[?1003l")
+ && write_string (ti->tk, "\x1b[?1004l")
+
&& write_string (ti->tk, "\x1b[?1005l")
&& write_string (ti->tk, "\x1b[?1006l")
&& write_string (ti->tk, "\x1b[?1015l");
@@ -411,8 +413,12 @@ start_driver (termo_t *tk, void *info)
// Disable everything mouse-related first
if (!mouse_reset (ti))
return false;
+
+ // Enable focus tracking opportunistically and automatically,
+ // as it basically doesn't have any negative consequences at all
return mouse_set_proto (ti, tk->mouse_proto, true)
- && mouse_set_tracking_mode (ti, tk->mouse_tracking, true);
+ && mouse_set_tracking_mode (ti, tk->mouse_tracking, true)
+ && write_string (ti->tk, "\x1b[?1004h");
}
static int
--
cgit v1.2.3-70-g09d2