static void ttyresize(int, int);
static void ttywrite(const char *, size_t);
static void ttyresize(int, int);
static void ttywrite(const char *, size_t);
static void xdraws(char *, Glyph, int, int, int);
static void xhints(void);
static void xclear(int, int, int, int);
static void xdraws(char *, Glyph, int, int, int);
static void xhints(void);
static void xclear(int, int, int, int);
static void expose(XEvent *);
static char* kmap(KeySym);
static void kpress(XEvent *);
static void resize(XEvent *);
static void expose(XEvent *);
static char* kmap(KeySym);
static void kpress(XEvent *);
static void resize(XEvent *);
-void
-xbell(void) {
- XSetForeground(xw.dis, dc.gc, dc.col[BellCol]);
- XFillRectangle(xw.dis, xw.win, dc.gc, BORDER, BORDER, xw.bufw, xw.bufh);
- XFlush(xw.dis);
- usleep(BellTime);
- draw(SCREEN_REDRAW);
-}
-
static int oldx = 0;
static int oldy = 0;
Glyph g = {' ', ATTR_NULL, DefaultBG, DefaultCS, 0};
static int oldx = 0;
static int oldy = 0;
Glyph g = {' ', ATTR_NULL, DefaultBG, DefaultCS, 0};
if(term.line[y][x].state & GLYPH_SET)
xdrawc(x, y, term.line[y][x]);
if(term.line[y][x].state & GLYPH_SET)
xdrawc(x, y, term.line[y][x]);
XCopyArea(xw.dis, xw.buf, xw.win, dc.gc, 0, 0, xw.bufw, xw.bufh, BORDER, BORDER);
XFlush(xw.dis);
}
XCopyArea(xw.dis, xw.buf, xw.win, dc.gc, 0, 0, xw.bufw, xw.bufh, BORDER, BORDER);
XFlush(xw.dis);
}
if(i > 0)
xdraws(buf, base, ox, y, i);
}
if(i > 0)
xdraws(buf, base, ox, y, i);
}
XCopyArea(xw.dis, xw.buf, xw.win, dc.gc, 0, 0, xw.bufw, xw.bufh, BORDER, BORDER);
XFlush(xw.dis);
}
XCopyArea(xw.dis, xw.buf, xw.win, dc.gc, 0, 0, xw.bufw, xw.bufh, BORDER, BORDER);
XFlush(xw.dis);
}
+void
+xseturgency(int add) {
+ XWMHints *h = XGetWMHints(xw.dis, xw.win);
+ h->flags = add ? (h->flags | XUrgencyHint) : (h->flags & ~XUrgencyHint);
+ XSetWMHints(xw.dis, xw.win, h);
+ XFree(h);
+}
+
+void
+focus(XEvent *ev) {
+ if((xw.hasfocus = ev->type == FocusIn))
+ xseturgency(0);
+}
+
XResizeWindow(xw.dis, xw.win, xw.w, xw.h); /* XXX: fix resize bug in wmii (?) */
XResizeWindow(xw.dis, xw.win, xw.w, xw.h); /* XXX: fix resize bug in wmii (?) */