summaryrefslogtreecommitdiff
path: root/st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
diff options
context:
space:
mode:
authorShubham Saini <shubham6405@gmail.com>2020-05-16 17:43:31 +0000
committerShubham Saini <shubham6405@gmail.com>2020-05-16 17:43:31 +0000
commit16d45c32c20d7b3db8ba2533ca9d414d8cd308f2 (patch)
treef829957546b740e6897eba24c8f49bb4c170044e /st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
gone full suckless
Diffstat (limited to 'st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff')
-rw-r--r--st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff63
1 files changed, 63 insertions, 0 deletions
diff --git a/st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff b/st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
new file mode 100644
index 0000000..fbade29
--- /dev/null
+++ b/st/patches/st-scrollback-mouse-altscreen-20200416-5703aa0.diff
@@ -0,0 +1,63 @@
1diff --git a/config.def.h b/config.def.h
2index 4b3bf15..1986316 100644
3--- a/config.def.h
4+++ b/config.def.h
5@@ -163,8 +163,8 @@ static uint forcemousemod = ShiftMask;
6 */
7 static MouseShortcut mshortcuts[] = {
8 /* mask button function argument release */
9- { ShiftMask, Button4, kscrollup, {.i = 1} },
10- { ShiftMask, Button5, kscrolldown, {.i = 1} },
11+ { XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1 },
12+ { XK_ANY_MOD, Button5, kscrolldown, {.i = 1}, 0, /* !alt */ -1 },
13 { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
14 { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
15 { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
16diff --git a/st.c b/st.c
17index f8b6f67..dd4cb31 100644
18--- st.c
19+++ st.c
20@@ -1045,6 +1045,11 @@ tnew(int col, int row)
21 treset();
22 }
23
24+int tisaltscr(void)
25+{
26+ return IS_SET(MODE_ALTSCREEN);
27+}
28+
29 void
30 tswapscreen(void)
31 {
32diff --git a/st.h b/st.h
33index 1332cf1..f9ad815 100644
34--- st.h
35+++ st.h
36@@ -89,6 +89,7 @@ void sendbreak(const Arg *);
37 void toggleprinter(const Arg *);
38
39 int tattrset(int);
40+int tisaltscr(void);
41 void tnew(int, int);
42 void tresize(int, int);
43 void tsetdirtattr(int);
44diff --git a/x.c b/x.c
45index e5f1737..b8fbd7b 100644
46--- x.c
47+++ x.c
48@@ -34,6 +34,7 @@ typedef struct {
49 void (*func)(const Arg *);
50 const Arg arg;
51 uint release;
52+ int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */
53 } MouseShortcut;
54
55 typedef struct {
56@@ -446,6 +447,7 @@ mouseaction(XEvent *e, uint release)
57 for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
58 if (ms->release == release &&
59 ms->button == e->xbutton.button &&
60+ (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
61 (match(ms->mod, state) || /* exact or forced */
62 match(ms->mod, state & ~forcemousemod))) {
63 ms->func(&(ms->arg));