static void xdraws(char *, Glyph, int, int, int, int);
static void xhints(void);
static void xclear(int, int, int, int);
-static void xcopy(void);
static void xdrawcursor(void);
static void xinit(void);
static void xloadcols(void);
return;
sel.bx = -1;
tsetdirt(sel.b.y, sel.e.y);
- draw();
}
void
clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
-
- XFlush(xw.dpy);
}
void
}
memcpy(&sel.tclick2, &sel.tclick1, sizeof(struct timeval));
gettimeofday(&sel.tclick1, NULL);
- draw();
}
void
int starty = MIN(oldey, sel.ey);
int endy = MAX(oldey, sel.ey);
tsetdirt(starty, endy);
- draw();
}
}
}
XDrawLine(xw.dpy, xw.buf, dc.gc, winx, winy+1, winx+width-1, winy+1);
}
-/* copy buffer pixmap to screen pixmap */
-void
-xcopy() {
- XdbeSwapInfo swpinfo[1] = {{xw.win, XdbeCopied}};
- XdbeSwapBuffers(xw.dpy, swpinfo, 1);
-}
-
void
xdrawcursor(void) {
static int oldx = 0;
} else
xclear(oldx, oldy, oldx, oldy);
- xcopy();
-
/* draw the new one */
if(!(term.c.state & CURSOR_HIDE)) {
if(!(xw.state & WIN_FOCUSED))
xdraws(g.c, g, term.c.x, term.c.y, 1, sl);
oldx = term.c.x, oldy = term.c.y;
}
-
- xcopy();
}
void
void
draw() {
+ XdbeSwapInfo swpinfo[1] = {{xw.win, XdbeCopied}};
+
drawregion(0, 0, term.col, term.row);
- xcopy();
+ XdbeSwapBuffers(xw.dpy, swpinfo, 1);
}
void
if(!e->count)
xw.state &= ~WIN_REDRAW;
}
- xcopy();
}
void
xseturgency(0);
} else
xw.state &= ~WIN_FOCUSED;
- draw();
}
char*
} else if(e->xclient.data.l[1] == XEMBED_FOCUS_OUT) {
xw.state &= ~WIN_FOCUSED;
}
- draw();
}
}
if(FD_ISSET(cmdfd, &rfd))
ttyread();
- draw();
-
while(XPending(xw.dpy)) {
XNextEvent(xw.dpy, &ev);
if(XFilterEvent(&ev, xw.win))
if(handler[ev.type])
(handler[ev.type])(&ev);
}
+
+ draw();
+ XFlush(xw.dpy);
}
}