iAdding mouse colour/shape settings - st - Simple Terminal Err gopher.r-36.net 70 i Err gopher.r-36.net 70 1Log /scm/st//log.gph gopher.r-36.net 70 1Files /scm/st//files.gph gopher.r-36.net 70 1Refs /scm/st//refs.gph gopher.r-36.net 70 1README /scm/st//file/README.gph gopher.r-36.net 70 1LICENSE /scm/st//file/LICENSE.gph gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1commit ee5cad439b427fa974903a6f0bb2689d11119d89 /scm/st//commit/ee5cad439b427fa974903a6f0bb2689d11119d89.gph gopher.r-36.net 70 1parent dc33d1d66e89ee974cc6d7cfa2efb693ce67aa86 /scm/st//commit/dc33d1d66e89ee974cc6d7cfa2efb693ce67aa86.gph gopher.r-36.net 70 hAuthor: Alex Kozadaev URL:mailto:akozadaev at yahoo com gopher.r-36.net 70 iDate: Tue, 28 Jul 2015 10:30:14 +0100 Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iAdding mouse colour/shape settings Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iDiffstat: Err gopher.r-36.net 70 i config.def.h | 8 ++++++++ Err gopher.r-36.net 70 i st.c | 20 ++++++++++++++++---- Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i2 files changed, 24 insertions(+), 4 deletions(-) Err gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1diff --git a/config.def.h b/config.def.h /scm/st//file/config.def.h.gph gopher.r-36.net 70 i@@ -105,6 +105,14 @@ static unsigned int defaultfg = 7; Err gopher.r-36.net 70 i static unsigned int defaultbg = 0; Err gopher.r-36.net 70 i static unsigned int defaultcs = 256; Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i+/* Err gopher.r-36.net 70 i+ * Default colour and shape of the mouse cursor Err gopher.r-36.net 70 i+ */ Err gopher.r-36.net 70 i+static unsigned int mouseshape = XC_xterm; Err gopher.r-36.net 70 i+static unsigned int mousefg = 7; Err gopher.r-36.net 70 i+static unsigned int mousebg = 0; Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i /* Err gopher.r-36.net 70 i * Colors used, when the specific fg == defaultfg. So in reverse mode this Err gopher.r-36.net 70 i * will reverse too. Another logic would only make the simple feature too Err gopher.r-36.net 70 1diff --git a/st.c b/st.c /scm/st//file/st.c.gph gopher.r-36.net 70 i@@ -3411,6 +3411,7 @@ xinit(void) Err gopher.r-36.net 70 i Cursor cursor; Err gopher.r-36.net 70 i Window parent; Err gopher.r-36.net 70 i pid_t thispid = getpid(); Err gopher.r-36.net 70 i+ XColor xmousefg, xmousebg; Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i if (!(xw.dpy = XOpenDisplay(NULL))) Err gopher.r-36.net 70 i die("Can't open display\n"); Err gopher.r-36.net 70 i@@ -3483,11 +3484,22 @@ xinit(void) Err gopher.r-36.net 70 i die("XCreateIC failed. Could not obtain input method.\n"); Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i /* white cursor, black outline */ Err gopher.r-36.net 70 i- cursor = XCreateFontCursor(xw.dpy, XC_xterm); Err gopher.r-36.net 70 i+ cursor = XCreateFontCursor(xw.dpy, mouseshape); Err gopher.r-36.net 70 i XDefineCursor(xw.dpy, xw.win, cursor); Err gopher.r-36.net 70 i- XRecolorCursor(xw.dpy, cursor, Err gopher.r-36.net 70 i- &(XColor){.red = 0xffff, .green = 0xffff, .blue = 0xffff}, Err gopher.r-36.net 70 i- &(XColor){.red = 0x0000, .green = 0x0000, .blue = 0x0000}); Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i+ if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { Err gopher.r-36.net 70 i+ xmousefg.red = 0xffff; Err gopher.r-36.net 70 i+ xmousefg.green = 0xffff; Err gopher.r-36.net 70 i+ xmousefg.blue = 0xffff; Err gopher.r-36.net 70 i+ } Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i+ if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) { Err gopher.r-36.net 70 i+ xmousebg.red = 0x0000; Err gopher.r-36.net 70 i+ xmousebg.green = 0x0000; Err gopher.r-36.net 70 i+ xmousebg.blue = 0x0000; Err gopher.r-36.net 70 i+ } Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i+ XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); Err gopher.r-36.net 70 i xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); Err gopher.r-36.net 70 .