summaryrefslogtreecommitdiff
path: root/st/patches/st-swapmouse-0.8.4.diff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-08 15:21:28 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-08 15:21:28 +0900
commit4437d5b3c3eea76f6e2b0fd4a2ba21c02a098aeb (patch)
treee8dcb20bf144aacf88f93b012dccacdeb08015cd /st/patches/st-swapmouse-0.8.4.diff
parentc2b06f0d5795a789f4ddab459179ff89aedfee98 (diff)
updates
Diffstat (limited to 'st/patches/st-swapmouse-0.8.4.diff')
-rw-r--r--st/patches/st-swapmouse-0.8.4.diff37
1 files changed, 37 insertions, 0 deletions
diff --git a/st/patches/st-swapmouse-0.8.4.diff b/st/patches/st-swapmouse-0.8.4.diff
new file mode 100644
index 0000000..d948dae
--- /dev/null
+++ b/st/patches/st-swapmouse-0.8.4.diff
@@ -0,0 +1,37 @@
+diff -up st-0.8.4-ori/x.c st-0.8.4/x.c
+--- st-0.8.4-ori/x.c 2020-06-19 14:59:45.000000000 +0530
++++ st-0.8.4/x.c 2020-07-20 03:39:56.260922736 +0530
+@@ -254,6 +254,9 @@ static char *opt_title = NULL;
+
+ static int oldbutton = 3; /* button event on startup: 3 = release */
+
++static Cursor cursor;
++static XColor xmousefg, xmousebg;
++
+ void
+ clipcopy(const Arg *dummy)
+ {
+@@ -1099,10 +1102,8 @@ void
+ xinit(int cols, int rows)
+ {
+ XGCValues gcvalues;
+- Cursor cursor;
+ Window parent;
+ pid_t thispid = getpid();
+- XColor xmousefg, xmousebg;
+
+ if (!(xw.dpy = XOpenDisplay(NULL)))
+ die("can't open display\n");
+@@ -1683,6 +1684,12 @@ xsetmode(int set, unsigned int flags)
+ {
+ int mode = win.mode;
+ MODBIT(win.mode, set, flags);
++ if (flags & MODE_MOUSE) {
++ if (win.mode & MODE_MOUSE)
++ XUndefineCursor(xw.dpy, xw.win);
++ else
++ XDefineCursor(xw.dpy, xw.win, cursor);
++ }
+ if ((win.mode & MODE_REVERSE) != (mode & MODE_REVERSE))
+ redraw();
+ }