aboutsummaryrefslogtreecommitdiff
path: root/patches/st-scrollback-mouse-altscreen-0.8.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/st-scrollback-mouse-altscreen-0.8.diff')
-rw-r--r--patches/st-scrollback-mouse-altscreen-0.8.diff66
1 files changed, 66 insertions, 0 deletions
diff --git a/patches/st-scrollback-mouse-altscreen-0.8.diff b/patches/st-scrollback-mouse-altscreen-0.8.diff
new file mode 100644
index 0000000..8ee58d9
--- /dev/null
+++ b/patches/st-scrollback-mouse-altscreen-0.8.diff
@@ -0,0 +1,66 @@
+diff --git a/config.def.h b/config.def.h
+index feec7e2..f1a9768 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -162,8 +162,8 @@ static MouseShortcut mshortcuts[] = {
+
+ MouseKey mkeys[] = {
+ /* button mask function argument */
+- { Button4, ShiftMask, kscrollup, {.i = 1} },
+- { Button5, ShiftMask, kscrolldown, {.i = 1} },
++ { Button4, XK_NO_MOD, kscrollup, {.i = 1} },
++ { Button5, XK_NO_MOD, kscrolldown, {.i = 1} },
+ };
+
+ /* Internal keyboard shortcuts. */
+diff --git a/st.c b/st.c
+index 1d8c12a..458dcfa 100644
+--- a/st.c
++++ b/st.c
+@@ -1051,6 +1051,11 @@ tnew(int col, int row)
+ treset();
+ }
+
++int tisaltscr(void)
++{
++ return IS_SET(MODE_ALTSCREEN);
++}
++
+ void
+ tswapscreen(void)
+ {
+diff --git a/st.h b/st.h
+index cdd25ae..e6143f0 100644
+--- a/st.h
++++ b/st.h
+@@ -99,6 +99,7 @@ void sendbreak(const Arg *);
+ void toggleprinter(const Arg *);
+
+ int tattrset(int);
++int tisaltscr(void);
+ void tnew(int, int);
+ void tresize(int, int);
+ void tsetdirtattr(int);
+diff --git a/x.c b/x.c
+index 1de5f6c..991bc3e 100644
+--- a/x.c
++++ b/x.c
+@@ -417,11 +417,13 @@ bpress(XEvent *e)
+ return;
+ }
+
+- for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
+- if (e->xbutton.button == ms->b
+- && match(ms->mask, e->xbutton.state)) {
+- ttywrite(ms->s, strlen(ms->s), 1);
+- return;
++ if (tisaltscr()) {
++ for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
++ if (e->xbutton.button == ms->b
++ && match(ms->mask, e->xbutton.state)) {
++ ttywrite(ms->s, strlen(ms->s), 1);
++ return;
++ }
+ }
+ }
+