Browse Source

change X cursor to "I".

master
Aurélien Aptel 14 years ago
parent
commit
0a208cb616
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      st.c

+ 11
- 2
st.c View File

@ -16,10 +16,11 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/keysym.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/keysym.h>
#if defined(__linux) #if defined(__linux)
#include <pty.h> #include <pty.h>
@ -1503,6 +1504,7 @@ initfonts(char *fontstr, char *bfontstr)
void void
xinit(void) { xinit(void) {
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
Cursor cursor;
if(!(xw.dpy = XOpenDisplay(NULL))) if(!(xw.dpy = XOpenDisplay(NULL)))
die("Can't open display\n"); die("Can't open display\n");
@ -1550,6 +1552,13 @@ xinit(void) {
/* gc */ /* gc */
dc.gc = XCreateGC(xw.dpy, xw.win, 0, NULL); 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); XMapWindow(xw.dpy, xw.win);
xhints(); xhints();
XStoreName(xw.dpy, xw.win, opt_title ? opt_title : "st"); XStoreName(xw.dpy, xw.win, opt_title ? opt_title : "st");


Loading…
Cancel
Save