Make win variable internal to x.c There was only a single reference to the `win` variable in st.c, so exporting that to x.c allows us to rid ourselves of another extern. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Devin J. Pohly djpohly@gmail.com
M
st.c
→
st.c
@@ -170,7 +170,6 @@
static ssize_t xwrite(int, const char *, size_t); /* Globals */ -TermWindow win; Term term; Selection sel; int cmdfd;@@ -1683,11 +1682,8 @@ break;
case ' ': switch (csiescseq.mode[1]) { case 'q': /* DECSCUSR -- Set Cursor Style */ - DEFAULT(csiescseq.arg[0], 1); - if (!BETWEEN(csiescseq.arg[0], 0, 6)) { + if (xsetcursor(csiescseq.arg[0])) goto unknown; - } - win.cursor = csiescseq.arg[0]; break; default: goto unknown;
M
x.c
→
x.c
@@ -187,6 +187,7 @@ /* Globals */
static DC dc; static XWindow xw; static XSelection xsel; +static TermWindow win; enum window_state { WIN_VISIBLE = 1,@@ -1613,6 +1614,16 @@ xsetpointermotion(int set)
{ MODBIT(xw.attrs.event_mask, set, PointerMotionMask); XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); +} + +int +xsetcursor(int cursor) +{ + DEFAULT(cursor, 1); + if (!BETWEEN(cursor, 0, 6)) + return 1; + win.cursor = cursor; + return 0; } void