X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=d7d70e7007342390bac193588e308560343bae17;hb=44db38a5f8560564851683f80e1a649836e5885c;hp=b350225db776497b5eff04fc9e78acbaf5d6da9e;hpb=5984657c001fe5b4690cef5ddffe11acbf7da7f2;p=st.git diff --git a/st.c b/st.c index b350225..d7d70e7 100644 --- a/st.c +++ b/st.c @@ -835,10 +835,6 @@ selnotify(XEvent *e) { *repl++ = '\r'; } - last = data + nitems * format / 8; - repl = data; - - ttywrite((const char *)data, nitems * format / 8); XFree(data); /* number of 32-bit chunks returned */ @@ -2362,10 +2358,8 @@ xresize(int col, int row) { XFreePixmap(xw.dpy, xw.buf); xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, DefaultDepth(xw.dpy, xw.scr)); - XSetForeground(xw.dpy, dc.gc, dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg].pixel); - XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h); - XftDrawChange(xw.draw, xw.buf); + xclear(0, 0, xw.w, xw.h); } static inline ushort @@ -2972,14 +2966,33 @@ xdrawcursor(void) { /* draw the new one */ if(!(IS_SET(MODE_HIDE))) { - if(!(xw.state & WIN_FOCUSED)) - g.bg = defaultucs; - - if(IS_SET(MODE_REVERSE)) - g.mode |= ATTR_REVERSE, g.fg = defaultcs, g.bg = defaultfg; + if(xw.state & WIN_FOCUSED) { + if(IS_SET(MODE_REVERSE)) { + g.mode |= ATTR_REVERSE; + g.fg = defaultcs; + g.bg = defaultfg; + } - sl = utf8size(g.c); - xdraws(g.c, g, term.c.x, term.c.y, 1, sl); + sl = utf8size(g.c); + xdraws(g.c, g, term.c.x, term.c.y, 1, sl); + } else { + XftDrawRect(xw.draw, &dc.col[defaultcs], + borderpx + term.c.x * xw.cw, + borderpx + term.c.y * xw.ch, + xw.cw - 1, 1); + XftDrawRect(xw.draw, &dc.col[defaultcs], + borderpx + term.c.x * xw.cw, + borderpx + term.c.y * xw.ch, + 1, xw.ch - 1); + XftDrawRect(xw.draw, &dc.col[defaultcs], + borderpx + (term.c.x + 1) * xw.cw - 1, + borderpx + term.c.y * xw.ch, + 1, xw.ch - 1); + XftDrawRect(xw.draw, &dc.col[defaultcs], + borderpx + term.c.x * xw.cw, + borderpx + (term.c.y + 1) * xw.ch - 1, + xw.cw, 1); + } oldx = term.c.x, oldy = term.c.y; } } @@ -3404,6 +3417,8 @@ run: xinit(); ttynew(); selinit(); + if(xw.isfixed) + cresize(xw.h, xw.w); run(); return 0;