aboutsummaryrefslogtreecommitdiffhomepage
path: root/x.c
diff options
context:
space:
mode:
authorasparagii <michele.lambertucci1@gmail.com>2022-01-27 15:49:27 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-02-03 16:09:07 +0300
commita6d484d8723d493bc09a5122128aaea729adaa80 (patch)
tree782ff5805fabcfa8b1795eb760e23c13f19c6b04 /x.c
parente4912814c02fdf4fae9fe9b655ee147f714ceb0d (diff)
downloadst-fork-a6d484d8723d493bc09a5122128aaea729adaa80.tar.gz
st-scrollback-mouse-altscreen
Source: https://st.suckless.org/patches/scrollback/
Diffstat (limited to 'x.c')
-rw-r--r--x.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/x.c b/x.c
index 3759455..af0dbe6 100644
--- a/x.c
+++ b/x.c
@@ -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 {
@@ -458,6 +459,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));