aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PATCHES1
-rw-r--r--config.def.h8
-rw-r--r--config.mk2
-rw-r--r--x.c17
4 files changed, 8 insertions, 20 deletions
diff --git a/PATCHES b/PATCHES
index 5cb7b6f..030ad04 100644
--- a/PATCHES
+++ b/PATCHES
@@ -5,4 +5,5 @@ st-desktopentry-0.8.5.diff
st-expected-anysize-0.9.diff
st-scrollback-0.9.2.diff
st-scrollback-reflow-0.9.2.diff
+st-themed_cursor-0.8.1.diff
st-undercurl-0.9-20240103.diff
diff --git a/config.def.h b/config.def.h
index 330f466..86286cd 100644
--- a/config.def.h
+++ b/config.def.h
@@ -161,11 +161,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
@@ -191,6 +190,7 @@ static MouseShortcut mshortcuts[] = {
{ XK_ANY_MOD, Button4, kscrollup, {.i = 3}, 0 },
{ XK_ANY_MOD, Button5, kscrolldown, {.i = 3}, 0 },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button3, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
diff --git a/config.mk b/config.mk
index a6c3829..69f0498 100644
--- a/config.mk
+++ b/config.mk
@@ -17,7 +17,7 @@ PKG_CONFIG = pkg-config
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 e2c7bdc..f6e066b 100644
--- a/x.c
+++ b/x.c
@@ -14,6 +14,7 @@
#include <X11/keysym.h>
#include <X11/Xft/Xft.h>
#include <X11/XKBlib.h>
+#include <X11/Xcursor/Xcursor.h>
char *argv0;
#include "arg.h"
@@ -1215,23 +1216,9 @@ xinit(int cols, int rows)
}
/* 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);