diff options
author | Tim Keller <tjkeller.xyz> | 2025-01-11 15:07:46 -0600 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2025-01-11 15:07:46 -0600 |
commit | 3f8366fe353fe7d161821c282a135fb9d6184c35 (patch) | |
tree | 9b7de16cb8bc454847be1eff220122a5f9ec2bc7 | |
parent | 296c863791a47eabd4ec64c35686d7eaf000709c (diff) | |
download | st-3f8366fe353fe7d161821c282a135fb9d6184c35.tar.xz st-3f8366fe353fe7d161821c282a135fb9d6184c35.zip |
add themed cursor patch and button 3 paste
-rw-r--r-- | PATCHES | 1 | ||||
-rw-r--r-- | config.def.h | 8 | ||||
-rw-r--r-- | config.mk | 2 | ||||
-rw-r--r-- | x.c | 17 |
4 files changed, 8 insertions, 20 deletions
@@ -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~"} }, @@ -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` @@ -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); |