summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2019-07-16 19:06:22 +0100
committerDrew DeVault <sir@cmpwn.com>2019-07-17 16:00:44 -0400
commit06af5391a37f5bb59571a641ad832e45d8f39f1e (patch)
treefcfe7d7a5ce5deb7d725031c82c756df7c3dbcba
parent8534720e724f4fd38c7ef4fed1e95bc10aa08bfa (diff)
downloadaerc-06af5391a37f5bb59571a641ad832e45d8f39f1e.tar.gz
Add MouseEnabled config setting
This patch adds the ability to control whether aerc captures mouseevents
or not. By default it will be set to not capture events.
-rw-r--r--config/aerc.conf.in5
-rw-r--r--config/config.go2
-rw-r--r--doc/aerc-config.5.scd5
-rw-r--r--lib/ui/ui.go4
4 files changed, 15 insertions, 1 deletions
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index f63c15a..41f4ce6 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -32,6 +32,11 @@ empty-message=(no messages)
 # Default: (no folders)
 empty-dirlist=(no folders)
 
+# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel
+#
+# Default: false
+mouse-enabled=false
+
 [viewer]
 #
 # Specifies the pager to use when displaying emails. Note that some filters
diff --git a/config/config.go b/config/config.go
index 89d2b49..aab3905 100644
--- a/config/config.go
+++ b/config/config.go
@@ -31,6 +31,7 @@ type UIConfig struct {
 	PreviewHeight     int      `ini:"preview-height"`
 	EmptyMessage      string   `ini:"empty-message"`
 	EmptyDirlist      string   `ini:"empty-dirlist"`
+	MouseEnabled      bool     `ini:"mouse-enabled"`
 }
 
 const (
@@ -320,6 +321,7 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
 			PreviewHeight:     12,
 			EmptyMessage:      "(no messages)",
 			EmptyDirlist:      "(no folders)",
+			MouseEnabled:      false,
 		},
 	}
 	// These bindings are not configurable
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 2f4f993..2e279cd 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -96,6 +96,11 @@ These options are configured in the *[ui]* section of aerc.conf.
 
 	Default: (no folders)
 
+*mouse-enabled*
+	Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel
+
+	Default: false
+
 ## VIEWER
 
 These options are configured in the *[viewer]* section of aerc.conf.
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index b057885..13b640b 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -32,7 +32,9 @@ func Initialize(conf *config.AercConfig,
 
 	screen.Clear()
 	screen.HideCursor()
-	screen.EnableMouse()
+	if conf.Ui.MouseEnabled {
+		screen.EnableMouse()
+	}
 
 	width, height := screen.Size()