Move window urgency handling entirely into x.c This allows us to make xseturgency internal. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Devin J. Pohly djpohly@gmail.com
5 files changed,
10 insertions(+),
9 deletions(-)
M
config.def.h
→
config.def.h
@@ -60,7 +60,7 @@ /*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling * it */ -static int bellvolume = 0; +int bellvolume = 0; /* default TERM value */ char termname[] = "st-256color";
M
win.h
→
win.h
@@ -8,7 +8,7 @@
void draw(void); void drawregion(int, int, int, int); -void xbell(int); +void xbell(void); void xclipcopy(void); void xclippaste(void); void xhints(void);@@ -16,7 +16,6 @@ void xloadcols(void);
int xsetcolorname(int, const char *); void xsettitle(char *); void xsetpointermotion(int); -void xseturgency(int); void xresize(int, int); void xselpaste(void); void xsetsel(char *, Time);
M
x.c
→
x.c
@@ -94,6 +94,7 @@ static void xloadfonts(char *, double);
static void xunloadfont(Font *); static void xunloadfonts(void); static void xsetenv(void); +static void xseturgency(int); static void expose(XEvent *); static void visibility(XEvent *);@@ -1521,9 +1522,12 @@ XFree(h);
} void -xbell(int vol) +xbell(void) { - XkbBell(xw.dpy, xw.win, vol, (Atom)NULL); + if (!(win.state & WIN_FOCUSED)) + xseturgency(1); + if (bellvolume) + XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL); } void