[hackers] [st] change X cursor to "I". || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Sun, 12 Dec 2010 12:32:18 +0000 (UTC)

changeset: 178:13e4ac490461
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Sun Dec 12 13:32:13 2010 +0100
files: st.c
description:
change X cursor to "I".

diff -r 8f1f5cf3fc44 -r 13e4ac490461 st.c
--- a/st.c Wed Dec 08 18:41:55 2010 +0100
+++ b/st.c Sun Dec 12 13:32:13 2010 +0100
@@ -16,10 +16,11 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
+#include <X11/Xatom.h>
 #include <X11/Xlib.h>
-#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <X11/cursorfont.h>
 #include <X11/keysym.h>
-#include <X11/Xutil.h>
 
 #if defined(__linux)
  #include <pty.h>
@@ -1503,6 +1504,7 @@
 void
 xinit(void) {
         XSetWindowAttributes attrs;
+ Cursor cursor;
 
         if(!(xw.dpy = XOpenDisplay(NULL)))
                 die("Can't open display\n");
@@ -1550,6 +1552,13 @@
         /* gc */
         dc.gc = XCreateGC(xw.dpy, xw.win, 0, NULL);
         
+ /* white cursor, black outline */
+ cursor = XCreateFontCursor(xw.dpy, XC_xterm);
+ XDefineCursor(xw.dpy, xw.win, cursor);
+ XRecolorCursor(xw.dpy, cursor,
+ &(XColor){.red = 0xffff, .green = 0xffff, .blue = 0xffff},
+ &(XColor){.red = 0x0000, .green = 0x0000, .blue = 0x0000});
+
         XMapWindow(xw.dpy, xw.win);
         xhints();
         XStoreName(xw.dpy, xw.win, opt_title ? opt_title : "st");
Received on Sun Dec 12 2010 - 13:32:18 CET

This archive was generated by hypermail 2.2.0 : Sun Dec 12 2010 - 13:36:04 CET