sites

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

commit c454207a99aa74e8ea7041760822b00cd507eba6
parent db9e7a88a8626f52c43d3e9968507c4a3c8f6d48
Author: Ashish Kumar Yadav <ashishkumar.yadav@students.iiserpune.ac.in>
Date:   Mon, 20 Jul 2020 13:38:05 +0530

[st][patch] swapmouse - new patch for st

changes mouse shape to global default in programs subscribed for mouse events.

Diffstat:
Ast.suckless.org/patches/swapmouse/index.md | 17+++++++++++++++++
Ast.suckless.org/patches/swapmouse/st-swapmouse-0.8.4.diff | 37+++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/swapmouse/index.md b/st.suckless.org/patches/swapmouse/index.md @@ -0,0 +1,17 @@ +swapmouse +=============== + +Description +----------- + +This patch changes the mouse shape to the global default when the running +program subscribes for mouse events, for instance, in programs like ranger and +fzf. It emulates the behaviour shown by vte terminals like termite. + +Download +-------- +* [st-swapmouse-0.8.4.diff](st-swapmouse-0.8.4.diff) + +Authors +------- +* Ashish Kumar Yadav - <ashishkumar.yadav@students.iiserpune.ac.in> diff --git a/st.suckless.org/patches/swapmouse/st-swapmouse-0.8.4.diff b/st.suckless.org/patches/swapmouse/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(); + }