From c34883a6bbc3fdc15adfea50e9e58efa7b783bc7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 25 Apr 2014 00:27:09 -0400 Subject: implement bells --- src/screen.c | 6 ++---- src/window-xlib.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/screen.c b/src/screen.c index 3d358b7..459f136 100644 --- a/src/screen.c +++ b/src/screen.c @@ -39,14 +39,12 @@ void runes_screen_process_string(RunesTerm *t, char *buf, size_t len) void runes_screen_audible_bell(RunesTerm *t) { - UNUSED(t); - fprintf(stderr, "audible_bell nyi\n"); + t->scr.audible_bell = 1; } void runes_screen_visual_bell(RunesTerm *t) { - UNUSED(t); - fprintf(stderr, "visual_bell nyi\n"); + t->scr.visual_bell = 1; } void runes_screen_show_string_ascii(RunesTerm *t, char *buf, size_t len) diff --git a/src/window-xlib.c b/src/window-xlib.c index fcb13ef..9b7b228 100644 --- a/src/window-xlib.c +++ b/src/window-xlib.c @@ -443,6 +443,16 @@ static void runes_window_backend_resize_window( static void runes_window_backend_flush(RunesTerm *t) { + if (t->scr.audible_bell) { + runes_window_backend_audible_bell(t); + t->scr.audible_bell = 0; + } + + if (t->scr.visual_bell) { + runes_window_backend_visual_bell(t); + t->scr.visual_bell = 0; + } + if (t->visual_bell_is_ringing) { return; } -- cgit v1.2.3-54-g00ecf