@@ 72,7 72,7 @@ Add `st.url = "github:siduck/st";` to your inputs and install `inputs.st.package
- xresources
- sync patch ( Better draw timing to reduce flicker/tearing and improve animation smoothness )
- live reload ( change colors/fonts on the fly )
- and more...
+- st-swapmouse
<br>
## Xresources live-reload
@@ 269,6 269,9 @@ static char *opt_title = NULL;
static int oldbutton = 3; /* button event on startup: 3 = release */
static int cursorblinks = 0;
+static Cursor cursor;
+static XColor xmousefg, xmousebg;
+
void
clipcopy(const Arg *dummy)
{
@@ 1216,10 1219,8 @@ void
xinit(int cols, int rows)
{
XGCValues gcvalues;
- Cursor cursor;
Window parent;
pid_t thispid = getpid();
- XColor xmousefg, xmousebg;
XWindowAttributes attr;
XVisualInfo vis;
@@ 1875,6 1876,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();
}