aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2021-08-31 04:34:08 +0000
committerCy Schubert <cy@FreeBSD.org>2021-08-31 04:45:43 +0000
commit31aad68e55df749fad73589b7cb251dea7cee768 (patch)
tree74b9a5374c12ac28fe44178707be0c5d6a9ffa5a
parent0a22085145817b5cabaf71578a389795bf2239e3 (diff)
mail/exmh2: Chase toolkits/tk87 8.7a5
tk 8.7a5 introduced uniform mouse wheel event handling. Unfortunately this is incompatible with tcltk software written using Button-4 and Button-5 events. This patch replaces the legacy bindings with the new MouseWheel binding, using the new tk::MouseWheel helper to move the scrollbar. This is documented at https://core.tcl-lang.org/tips/doc/trunk/tip/474.md. The old bindings are left should anyone wish to use exmh2 with the older tk86, also requiring a user to modify Makefile to alter the dependency.
-rw-r--r--mail/exmh2/Makefile2
-rw-r--r--mail/exmh2/files/patch-lib_exwin.tcl28
2 files changed, 29 insertions, 1 deletions
diff --git a/mail/exmh2/Makefile b/mail/exmh2/Makefile
index 4f7371286df0..a8533f5ef6c4 100644
--- a/mail/exmh2/Makefile
+++ b/mail/exmh2/Makefile
@@ -4,7 +4,7 @@
PORTNAME= exmh
PORTVERSION= 2.9.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES+= mail tk
# XXX: Standard SF fails with a hung download
MASTER_SITES= https://sourceforge.net/projects/${PORTNAME}/files/${PORTNAME}/${PORTVERSION}/
diff --git a/mail/exmh2/files/patch-lib_exwin.tcl b/mail/exmh2/files/patch-lib_exwin.tcl
new file mode 100644
index 000000000000..cb6639714706
--- /dev/null
+++ b/mail/exmh2/files/patch-lib_exwin.tcl
@@ -0,0 +1,28 @@
+--- lib/exwin.tcl.orig 2017-11-09 20:42:24.000000000 -0800
++++ lib/exwin.tcl 2021-08-30 21:28:25.291533000 -0700
+@@ -101,12 +101,19 @@
+ }
+
+ proc mscroll {bindtag num} {
+- bind $bindtag <Button-5> [list %W yview scroll $num units]
+- bind $bindtag <Button-4> [list %W yview scroll -$num units]
+- bind $bindtag <Shift-Button-5> [list %W yview scroll 1 units]
+- bind $bindtag <Shift-Button-4> [list %W yview scroll -1 units]
+- bind $bindtag <Control-Button-5> [list %W yview scroll 1 pages]
+- bind $bindtag <Control-Button-4> [list %W yview scroll -1 pages]
++ # Prior to tcl 8.7a5:
++ # bind $bindtag <Button-5> [list %W yview scroll $num units]
++ # bind $bindtag <Button-4> [list %W yview scroll -$num units]
++ # bind $bindtag <Shift-Button-5> [list %W yview scroll 1 units]
++ # bind $bindtag <Shift-Button-4> [list %W yview scroll -1 units]
++ # bind $bindtag <Control-Button-5> [list %W yview scroll 1 pages]
++ # bind $bindtag <Control-Button-4> [list %W yview scroll -1 pages]
++
++ # tcl 8.7a5 and later (units can be pixels/units/pages). See
++ # https://core.tcl-lang.org/tips/doc/trunk/tip/474.md for more info:
++ bind $bindtag <MouseWheel> [ list tk::MouseWheel %W y %D -$num units ]
++ bind $bindtag <Shift-MouseWheel> { tk::MouseWheel %W y %D -1 units }
++ bind $bindtag <Shift-MouseWheel> { tk::MouseWheel %W y %D -1 pages }
+ }
+
+