aboutsummaryrefslogtreecommitdiffstats
path: root/window-xlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'window-xlib.c')
-rw-r--r--window-xlib.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/window-xlib.c b/window-xlib.c
index 70cbf22..0051fae 100644
--- a/window-xlib.c
+++ b/window-xlib.c
@@ -19,7 +19,8 @@ static char *atom_names[RUNES_NUM_ATOMS] = {
"UTF8_STRING",
"WM_PROTOCOLS",
"RUNES_FLUSH",
- "RUNES_VISUAL_BELL"
+ "RUNES_VISUAL_BELL",
+ "RUNES_AUDIBLE_BELL"
};
struct function_key {
@@ -218,6 +219,21 @@ void runes_window_backend_request_visual_bell(RunesTerm *t)
XUnlockDisplay(t->w.dpy);
}
+void runes_window_backend_request_audible_bell(RunesTerm *t)
+{
+ XEvent e;
+
+ e.xclient.type = ClientMessage;
+ e.xclient.window = t->w.w;
+ e.xclient.format = 32;
+ e.xclient.data.l[0] = t->w.atoms[RUNES_ATOM_RUNES_AUDIBLE_BELL];
+
+ XSendEvent(t->w.dpy, t->w.w, False, NoEventMask, &e);
+ XLockDisplay(t->w.dpy);
+ XFlush(t->w.dpy);
+ XUnlockDisplay(t->w.dpy);
+}
+
void runes_window_backend_request_close(RunesTerm *t)
{
XEvent e;
@@ -423,6 +439,9 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
nanosleep(&tm, NULL);
runes_window_backend_flush(t);
}
+ else if (a == w->atoms[RUNES_ATOM_RUNES_AUDIBLE_BELL]) {
+ XBell(w->dpy, 0);
+ }
break;
}
default: