changed behaviour of mouseclicks
Now a rightclick on the message windows deletes ALL messages.
This commit is contained in:
parent
349493c196
commit
f237d8df84
5
dunst.1
5
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.
|
||||
|
12
dunst.c
12
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) {
|
||||
if(ev.xbutton.button == Button1) {
|
||||
delete_msg(NULL);
|
||||
} else {
|
||||
delete_all_msg();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KeyPress:
|
||||
|
Loading…
x
Reference in New Issue
Block a user