diff --git a/dunst.1 b/dunst.1 index 400c4ba..672b072 100644 --- a/dunst.1 +++ b/dunst.1 @@ -118,6 +118,11 @@ Possible placeholders are: %i iconname (including its path) .TP %I iconname (without its path) +.SH MOUSE +.BI leftclick +to Delete oldest messages and +.BI rightclick +Delete all messages. .SH EXAMPLES .BI "dunst " \-geometry " x2" Displays a maximum of two lines across the top of the screen. diff --git a/dunst.c b/dunst.c index 21ff352..9455695 100644 --- a/dunst.c +++ b/dunst.c @@ -80,6 +80,7 @@ int list_len(msg_queue_t *list); /* misc funtions */ void check_timeouts(void); +void delete_all_msg(void); void delete_msg(msg_queue_t *elem); void drawmsg(void); void dunst_printf(const char *fmt, ...); @@ -201,6 +202,13 @@ check_timeouts(void) { } } +void +delete_all_msg(void) { + while (msgqueue != NULL) { + delete_msg(NULL); + } +} + void delete_msg(msg_queue_t *elem) { msg_queue_t *cur; @@ -380,7 +388,11 @@ handleXEvents(void) { break; case ButtonPress: if(ev.xbutton.window == win) { - delete_msg(NULL); + if(ev.xbutton.button == Button1) { + delete_msg(NULL); + } else { + delete_all_msg(); + } } break; case KeyPress: