aboutsummaryrefslogtreecommitdiffstats
path: root/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-17 00:41:46 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-17 00:41:46 -0400
commitdf67c72ec5880abf98573e3b02beda0fec3c76cf (patch)
tree805cd6389a827ae0ace8aedf122bbc415e639bd5 /window-xlib.c
parent7ef5f47270688d8f35dbfff24ba3cf22e8f2d04a (diff)
downloadrunes-df67c72ec5880abf98573e3b02beda0fec3c76cf.tar.gz
runes-df67c72ec5880abf98573e3b02beda0fec3c76cf.zip
set urgent when we receive a bell
Diffstat (limited to 'window-xlib.c')
-rw-r--r--window-xlib.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/window-xlib.c b/window-xlib.c
index f3e943b..babf365 100644
--- a/window-xlib.c
+++ b/window-xlib.c
@@ -83,6 +83,8 @@ static void runes_window_backend_resize_window(
RunesTerm *t, int width, int height);
static void runes_window_backend_flush(RunesTerm *t);
static void runes_window_backend_draw_cursor(RunesTerm *t);
+static void runes_window_backend_set_urgent(RunesTerm *t);
+static void runes_window_backend_clear_urgent(RunesTerm *t);
void runes_window_backend_create_window(RunesTerm *t, int argc, char *argv[])
{
@@ -381,6 +383,7 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
t, e->xconfigure.width, e->xconfigure.height);
break;
case FocusIn:
+ runes_window_backend_clear_urgent(t);
runes_display_focus_in(t);
runes_window_backend_flush(t);
break;
@@ -408,6 +411,7 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
cairo_pattern_t *white;
struct timespec tm = { 0, 20000000 };
+ runes_window_backend_set_urgent(t);
white = cairo_pattern_create_rgb(1.0, 1.0, 1.0);
cairo_set_source(t->backend_cr, white);
cairo_paint(t->backend_cr);
@@ -484,3 +488,21 @@ static void runes_window_backend_draw_cursor(RunesTerm *t)
cairo_restore(t->backend_cr);
}
}
+
+static void runes_window_backend_set_urgent(RunesTerm *t)
+{
+ XWMHints *hints;
+
+ hints = XGetWMHints(t->w.dpy, t->w.w);
+ hints->flags |= XUrgencyHint;
+ XSetWMHints(t->w.dpy, t->w.w, hints);
+}
+
+static void runes_window_backend_clear_urgent(RunesTerm *t)
+{
+ XWMHints *hints;
+
+ hints = XGetWMHints(t->w.dpy, t->w.w);
+ hints->flags &= ~XUrgencyHint;
+ XSetWMHints(t->w.dpy, t->w.w, hints);
+}