diff options
| author | Alex Kozadaev <akozadaev at yahoo com> | 2015-07-28 10:30:14 +0100 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2015-07-28 12:21:11 +0200 |
| commit | ee5cad439b427fa974903a6f0bb2689d11119d89 (patch) | |
| tree | 7f13e99912dffa896ec428b18d5c422ccc1ed599 /st.c | |
| parent | Adding -T to the usage too. (diff) | |
| download | st-ee5cad439b427fa974903a6f0bb2689d11119d89.tar.gz st-ee5cad439b427fa974903a6f0bb2689d11119d89.zip | |
Adding mouse colour/shape settings
Diffstat (limited to '')
| -rw-r--r-- | st.c | 20 |
1 files changed, 16 insertions, 4 deletions
| @@ -3411,6 +3411,7 @@ xinit(void) | |||
| 3411 | Cursor cursor; | 3411 | Cursor cursor; |
| 3412 | Window parent; | 3412 | Window parent; |
| 3413 | pid_t thispid = getpid(); | 3413 | pid_t thispid = getpid(); |
| 3414 | XColor xmousefg, xmousebg; | ||
| 3414 | 3415 | ||
| 3415 | if (!(xw.dpy = XOpenDisplay(NULL))) | 3416 | if (!(xw.dpy = XOpenDisplay(NULL))) |
| 3416 | die("Can't open display\n"); | 3417 | die("Can't open display\n"); |
| @@ -3483,11 +3484,22 @@ xinit(void) | |||
| 3483 | die("XCreateIC failed. Could not obtain input method.\n"); | 3484 | die("XCreateIC failed. Could not obtain input method.\n"); |
| 3484 | 3485 | ||
| 3485 | /* white cursor, black outline */ | 3486 | /* white cursor, black outline */ |
| 3486 | cursor = XCreateFontCursor(xw.dpy, XC_xterm); | 3487 | cursor = XCreateFontCursor(xw.dpy, mouseshape); |
| 3487 | XDefineCursor(xw.dpy, xw.win, cursor); | 3488 | XDefineCursor(xw.dpy, xw.win, cursor); |
| 3488 | XRecolorCursor(xw.dpy, cursor, | 3489 | |
| 3489 | &(XColor){.red = 0xffff, .green = 0xffff, .blue = 0xffff}, | 3490 | if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { |
| 3490 | &(XColor){.red = 0x0000, .green = 0x0000, .blue = 0x0000}); | 3491 | xmousefg.red = 0xffff; |
| 3492 | xmousefg.green = 0xffff; | ||
| 3493 | xmousefg.blue = 0xffff; | ||
| 3494 | } | ||
| 3495 | |||
| 3496 | if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) { | ||
| 3497 | xmousebg.red = 0x0000; | ||
| 3498 | xmousebg.green = 0x0000; | ||
| 3499 | xmousebg.blue = 0x0000; | ||
| 3500 | } | ||
| 3501 | |||
| 3502 | XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); | ||
| 3491 | 3503 | ||
| 3492 | xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); | 3504 | xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); |
| 3493 | xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); | 3505 | xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); |
