From f601585389748694959c30ad67fd91b52a6b9fa8 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Thu, 29 Jul 2021 23:50:49 +0200 Subject: [PATCH] remove mouse patches --- st-scrollback-mouse-0.8.2.diff | 85 ---------------------------------- st-themed_cursor-0.8.1.diff | 68 --------------------------- 2 files changed, 153 deletions(-) delete mode 100644 st-scrollback-mouse-0.8.2.diff delete mode 100644 st-themed_cursor-0.8.1.diff diff --git a/st-scrollback-mouse-0.8.2.diff b/st-scrollback-mouse-0.8.2.diff deleted file mode 100644 index c49bf89..0000000 --- a/st-scrollback-mouse-0.8.2.diff +++ /dev/null @@ -1,85 +0,0 @@ -From 315f69069017122ca69d0319d0ad9481113fe5c8 Mon Sep 17 00:00:00 2001 -From: Jacob Prosser -Date: Fri, 26 Apr 2019 17:23:27 +1000 -Subject: [PATCH] Scrollback-Mouse for 0.8.2 - ---- - config.def.h | 10 ++++++++-- - st.h | 8 ++++++++ - x.c | 9 +++++++++ - 3 files changed, 25 insertions(+), 2 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 7326a74..ad20c4c 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -156,8 +156,14 @@ static unsigned int defaultattr = 11; - */ - static MouseShortcut mshortcuts[] = { - /* button mask string */ -- { Button4, XK_ANY_MOD, "\031" }, -- { Button5, XK_ANY_MOD, "\005" }, -+ { Button4, XK_NO_MOD, "\031" }, -+ { Button5, XK_NO_MOD, "\005" }, -+}; -+ -+MouseKey mkeys[] = { -+ /* button mask function argument */ -+ { Button4, ShiftMask, kscrollup, {.i = 1} }, -+ { Button5, ShiftMask, kscrolldown, {.i = 1} }, - }; - - /* Internal keyboard shortcuts. */ -diff --git a/st.h b/st.h -index 17a79e0..3ac7f57 100644 ---- a/st.h -+++ b/st.h -@@ -76,6 +76,13 @@ typedef union { - const void *v; - } Arg; - -+typedef struct { -+ uint b; -+ uint mask; -+ void (*func)(const Arg *); -+ const Arg arg; -+} MouseKey; -+ - void die(const char *, ...); - void redraw(void); - void draw(void); -@@ -122,3 +129,4 @@ extern char *termname; - extern unsigned int tabspaces; - extern unsigned int defaultfg; - extern unsigned int defaultbg; -+extern MouseKey mkeys[]; -diff --git a/x.c b/x.c -index 0422421..e9fd6e9 100644 ---- a/x.c -+++ b/x.c -@@ -409,6 +409,7 @@ bpress(XEvent *e) - { - struct timespec now; - MouseShortcut *ms; -+ MouseKey *mk; - int snap; - - if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { -@@ -424,6 +425,14 @@ bpress(XEvent *e) - } - } - -+ for (mk = mkeys; mk < mkeys + LEN(mkeys); mk++) { -+ if (e->xbutton.button == mk->b -+ && match(mk->mask, e->xbutton.state)) { -+ mk->func(&mk->arg); -+ return; -+ } -+ } -+ - if (e->xbutton.button == Button1) { - /* - * If the user clicks below predefined timeouts specific --- -2.21.0 - diff --git a/st-themed_cursor-0.8.1.diff b/st-themed_cursor-0.8.1.diff deleted file mode 100644 index ee89ecc..0000000 --- a/st-themed_cursor-0.8.1.diff +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 82b1b09..ffd6cde 100644 -+++ b/config.def.h -@@ -138,11 +138,10 @@ static unsigned int cols = 80; - static unsigned int rows = 24; - - /* -- * Default colour and shape of the mouse cursor -+ * Default shape of the mouse cursor - */ --static unsigned int mouseshape = XC_xterm; --static unsigned int mousefg = 7; --static unsigned int mousebg = 0; -+ -+static char* mouseshape = "xterm"; - - /* - * Color used to display font attributes when fontconfig selected a font which -diff --git a/config.mk b/config.mk -index 039c42c..a0cb4fd 100644 ---- a/config.mk -+++ b/config.mk -@@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib - INCS = -I$(X11INC) \ - `pkg-config --cflags fontconfig` \ - `pkg-config --cflags freetype2` --LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ -+LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXcursor \ - `pkg-config --libs fontconfig` \ - `pkg-config --libs freetype2` - -diff --git a/x.c b/x.c -index c343ba2..5a7461e 100644 ---- a/x.c -+++ b/x.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - static char *argv0; - #include "arg.h" -@@ -1076,23 +1079,9 @@ xinit(int cols, int rows) - die("XCreateIC failed. Could not obtain input method.\n"); - - /* white cursor, black outline */ -- cursor = XCreateFontCursor(xw.dpy, mouseshape); -+ cursor = XcursorLibraryLoadCursor(xw.dpy, mouseshape); - XDefineCursor(xw.dpy, xw.win, cursor); - -- if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { -- xmousefg.red = 0xffff; -- xmousefg.green = 0xffff; -- xmousefg.blue = 0xffff; -- } -- -- if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) { -- xmousebg.red = 0x0000; -- xmousebg.green = 0x0000; -- xmousebg.blue = 0x0000; -- } -- -- XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); -- - xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); - xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); - xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False);