Call xsetcursor to set win.cursor in main

In xsetcursor, remove "DEFAULT(cursor, 1)" because 0 is a valid value.
Increase max allowed value of cursor from 6 to 7 (st extension).
This commit is contained in:
bakkeby 2020-05-24 17:19:24 +02:00
parent f6637c640e
commit 0bb43eff81
1 changed files with 4 additions and 5 deletions

9
x.c
View File

@ -1825,8 +1825,8 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
/* draw the new one */ /* draw the new one */
if (IS_SET(MODE_FOCUSED)) { if (IS_SET(MODE_FOCUSED)) {
switch (win.cursor) { switch (win.cursor) {
case 7: /* st extension: snowman (U+2603) */ case 7: /* st extension */
g.u = 0x2603; g.u = 0x2603; /* snowman (U+2603) */
/* FALLTHROUGH */ /* FALLTHROUGH */
case 0: /* Blinking Block */ case 0: /* Blinking Block */
case 1: /* Blinking Block (Default) */ case 1: /* Blinking Block (Default) */
@ -2037,8 +2037,7 @@ xsetmode(int set, unsigned int flags)
int int
xsetcursor(int cursor) xsetcursor(int cursor)
{ {
DEFAULT(cursor, 1); if (!BETWEEN(cursor, 0, 7)) /* 7: st extension */
if (!BETWEEN(cursor, 0, 6))
return 1; return 1;
win.cursor = cursor; win.cursor = cursor;
return 0; return 0;
@ -2377,7 +2376,7 @@ main(int argc, char *argv[])
{ {
xw.l = xw.t = 0; xw.l = xw.t = 0;
xw.isfixed = False; xw.isfixed = False;
win.cursor = cursorshape; xsetcursor(cursorshape);
ARGBEGIN { ARGBEGIN {
case 'a': case 'a':