st-themed_cursor-0.8.1.diff - sites - public wiki contents of suckless.org
HTML git clone git://git.suckless.org/sites
DIR Log
DIR Files
DIR Refs
---
st-themed_cursor-0.8.1.diff (2059B)
---
1 diff --git a/config.def.h b/config.def.h
2 index 82b1b09..ffd6cde 100644
3 +++ b/config.def.h
4 @@ -138,11 +138,10 @@ static unsigned int cols = 80;
5 static unsigned int rows = 24;
6
7 /*
8 - * Default colour and shape of the mouse cursor
9 + * Default shape of the mouse cursor
10 */
11 -static unsigned int mouseshape = XC_xterm;
12 -static unsigned int mousefg = 7;
13 -static unsigned int mousebg = 0;
14 +
15 +static char* mouseshape = "xterm";
16
17 /*
18 * Color used to display font attributes when fontconfig selected a font which
19 diff --git a/config.mk b/config.mk
20 index 039c42c..a0cb4fd 100644
21 --- a/config.mk
22 +++ b/config.mk
23 @@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
24 INCS = -I$(X11INC) \
25 `pkg-config --cflags fontconfig` \
26 `pkg-config --cflags freetype2`
27 -LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
28 +LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXcursor \
29 `pkg-config --libs fontconfig` \
30 `pkg-config --libs freetype2`
31
32 diff --git a/x.c b/x.c
33 index c343ba2..5a7461e 100644
34 --- a/x.c
35 +++ b/x.c
36 @@ -14,6 +14,7 @@
37 #include <X11/keysym.h>
38 #include <X11/Xft/Xft.h>
39 #include <X11/XKBlib.h>
40 +#include <X11/Xcursor/Xcursor.h>
41
42 static char *argv0;
43 #include "arg.h"
44 @@ -1076,23 +1079,9 @@ xinit(int cols, int rows)
45 die("XCreateIC failed. Could not obtain input method.\n");
46
47 /* white cursor, black outline */
48 - cursor = XCreateFontCursor(xw.dpy, mouseshape);
49 + cursor = XcursorLibraryLoadCursor(xw.dpy, mouseshape);
50 XDefineCursor(xw.dpy, xw.win, cursor);
51
52 - if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
53 - xmousefg.red = 0xffff;
54 - xmousefg.green = 0xffff;
55 - xmousefg.blue = 0xffff;
56 - }
57 -
58 - if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
59 - xmousebg.red = 0x0000;
60 - xmousebg.green = 0x0000;
61 - xmousebg.blue = 0x0000;
62 - }
63 -
64 - XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg);
65 -
66 xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
67 xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
68 xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False);