summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Lee <dennis@dennislee.xyz>2020-06-30 18:01:26 -0700
committerDennis Lee <dennis@dennislee.xyz>2020-06-30 18:33:15 -0700
commitcf0807b3e97b4abe6c57ee512cd001a53ed05c81 (patch)
treebe065d58b583c869198111368a3132eaa5d1204a
parent222eac739d43c7a380b9a37db91bf61ed8dbc65a (diff)
use st-scrollback-mouse-altscreen-20190131-e23acb9
-rw-r--r--config.h6
-rw-r--r--st.c5
-rw-r--r--st.h1
-rw-r--r--x.c12
4 files changed, 15 insertions, 9 deletions
diff --git a/config.h b/config.h
index c8921bd..2adb571 100644
--- a/config.h
+++ b/config.h
@@ -228,10 +228,8 @@ static MouseShortcut mshortcuts[] = {
MouseKey mkeys[] = {
/* button mask function argument */
- { Button4, ShiftMask, kscrollup, {.i = 1} },
- { Button5, ShiftMask, kscrolldown, {.i = 1} },
- { Button4, MODKEY, kscrollup, {.i = 1} },
- { Button5, MODKEY, kscrolldown, {.i = 1} },
+ { Button4, XK_NO_MOD, kscrollup, {.i = 1} },
+ { Button5, XK_NO_MOD, kscrolldown, {.i = 1} },
{ Button4, TERMMOD, zoom, {.f = +1} },
{ Button5, TERMMOD, zoom, {.f = -1} },
};
diff --git a/st.c b/st.c
index 0e5e3f5..10e4b4d 100644
--- a/st.c
+++ b/st.c
@@ -1063,6 +1063,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 b85474b..b25b947 100644
--- a/st.h
+++ b/st.h
@@ -104,6 +104,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 c1f050b..3a99646 100644
--- a/x.c
+++ b/x.c
@@ -442,11 +442,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;
+ }
}
}