diff options
| author | Malfurious <m@lfurio.us> | 2020-06-26 19:55:41 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2026-01-17 20:00:23 -0500 |
| commit | 57e6bfbd12721471c4da0f41a158441052e7a527 (patch) | |
| tree | ce00cb66e975fbfdd953bde8455744e7aa52607f /x.c | |
| parent | 42bf9a1e00c4f348c6bd2bd0af4894f71a14768e (diff) | |
| download | st-57e6bfbd12721471c4da0f41a158441052e7a527.tar.gz st-57e6bfbd12721471c4da0f41a158441052e7a527.zip | |
patch: scrollback-mouse-altscreen
Apply the following patch on top of the previous two to allow scrollback
using mouse wheel only when not in MODE_ALTSCREEN. For example the
content is being scrolled instead of the scrollback buffer in less.
Consequently the Shift modifier for scrolling is not needed anymore.
The mouse and altscreen patches 20191024-a2c479c (and later, including
this one) are simpler and more robust because st gained better support
for customized mouse shortcuts. As a result, the altscreen patch doesn't
really need the mouse patch. However to keep it simple the instructions
stay the same: the alrscreen patch still applies on top of the (now very
minimal) mouse patch.
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -34,6 +34,7 @@ typedef struct { void (*func)(const Arg *); const Arg arg; uint release; + int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */ } MouseShortcut; typedef struct { @@ -462,6 +463,7 @@ mouseaction(XEvent *e, uint release) for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) { if (ms->release == release && ms->button == e->xbutton.button && + (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) && (match(ms->mod, state) || /* exact or forced */ match(ms->mod, state & ~forcemousemod))) { ms->func(&(ms->arg)); |
