From 626b0ae40c71b6c1e02ece79bf033432647381a6 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Tue, 10 Oct 2017 12:01:18 -0500 Subject: Move window urgency handling entirely into x.c This allows us to make xseturgency internal. Signed-off-by: Devin J. Pohly --- x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'x.c') diff --git a/x.c b/x.c index 426ca28..5b3c97b 100644 --- a/x.c +++ b/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 @@ xseturgency(int add) } 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 -- cgit v1.2.3-13-gbd6f