sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit c36d2e96f2265bfd11d1e7ac6d5785334d875495
parent 5abc801a1108bc72cae66781942335f7db38bf32
Author: Ivan Tham <pickfire@riseup.net>
Date:   Sat,  2 Feb 2019 13:29:05 +0800

[st][scrollback] Clean altscreen

Diffstat:
Mst.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20190131-e23acb9.diff | 38++++++--------------------------------
1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20190131-e23acb9.diff b/st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20190131-e23acb9.diff @@ -13,39 +13,11 @@ index a6d2fb9..16830c8 100644 }; /* Internal keyboard shortcuts. */ -diff --git a/st.c b/st.c -index 218ae73..f543305 100644 ---- a/st.c -+++ b/st.c -@@ -1058,6 +1058,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 3592957..23f4ca3 100644 ---- a/st.h -+++ b/st.h -@@ -95,6 +95,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 e9fd6e9..2dc315e 100644 +index e9fd6e9..31ecea8 100644 --- a/x.c +++ b/x.c -@@ -417,11 +417,13 @@ bpress(XEvent *e) +@@ -417,13 +417,14 @@ bpress(XEvent *e) return; } @@ -54,7 +26,7 @@ index e9fd6e9..2dc315e 100644 - && match(ms->mask, e->xbutton.state)) { - ttywrite(ms->s, strlen(ms->s), 1); - return; -+ if (tisaltscr()) { ++ if (IS_SET(MODE_ALTSCREEN)) + for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) { + if (e->xbutton.button == ms->b + && match(ms->mask, e->xbutton.state)) { @@ -62,5 +34,7 @@ index e9fd6e9..2dc315e 100644 + return; + } } - } +- } + for (mk = mkeys; mk < mkeys + LEN(mkeys); mk++) { + if (e->xbutton.button == mk->b