summaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--st.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/st.c b/st.c
index 2be6772..d528828 100644
--- a/st.c
+++ b/st.c
@@ -16,10 +16,11 @@
16#include <sys/types.h> 16#include <sys/types.h>
17#include <sys/wait.h> 17#include <sys/wait.h>
18#include <unistd.h> 18#include <unistd.h>
19#include <X11/Xlib.h>
20#include <X11/Xatom.h> 19#include <X11/Xatom.h>
21#include <X11/keysym.h> 20#include <X11/Xlib.h>
22#include <X11/Xutil.h> 21#include <X11/Xutil.h>
22#include <X11/cursorfont.h>
23#include <X11/keysym.h>
23 24
24#if defined(__linux) 25#if defined(__linux)
25 #include <pty.h> 26 #include <pty.h>
@@ -1503,6 +1504,7 @@ initfonts(char *fontstr, char *bfontstr)
1503void 1504void
1504xinit(void) { 1505xinit(void) {
1505 XSetWindowAttributes attrs; 1506 XSetWindowAttributes attrs;
1507 Cursor cursor;
1506 1508
1507 if(!(xw.dpy = XOpenDisplay(NULL))) 1509 if(!(xw.dpy = XOpenDisplay(NULL)))
1508 die("Can't open display\n"); 1510 die("Can't open display\n");
@@ -1550,6 +1552,13 @@ xinit(void) {
1550 /* gc */ 1552 /* gc */
1551 dc.gc = XCreateGC(xw.dpy, xw.win, 0, NULL); 1553 dc.gc = XCreateGC(xw.dpy, xw.win, 0, NULL);
1552 1554
1555 /* white cursor, black outline */
1556 cursor = XCreateFontCursor(xw.dpy, XC_xterm);
1557 XDefineCursor(xw.dpy, xw.win, cursor);
1558 XRecolorCursor(xw.dpy, cursor,
1559 &(XColor){.red = 0xffff, .green = 0xffff, .blue = 0xffff},
1560 &(XColor){.red = 0x0000, .green = 0x0000, .blue = 0x0000});
1561
1553 XMapWindow(xw.dpy, xw.win); 1562 XMapWindow(xw.dpy, xw.win);
1554 xhints(); 1563 xhints();
1555 XStoreName(xw.dpy, xw.win, opt_title ? opt_title : "st"); 1564 XStoreName(xw.dpy, xw.win, opt_title ? opt_title : "st");