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)
|
%i iconname (including its path)
|
||||||
.TP
|
.TP
|
||||||
%I iconname (without its path)
|
%I iconname (without its path)
|
||||||
|
.SH MOUSE
|
||||||
|
.BI leftclick
|
||||||
|
to Delete oldest messages and
|
||||||
|
.BI rightclick
|
||||||
|
Delete all messages.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.BI "dunst " \-geometry " x2"
|
.BI "dunst " \-geometry " x2"
|
||||||
Displays a maximum of two lines across the top of the screen.
|
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 */
|
/* misc funtions */
|
||||||
void check_timeouts(void);
|
void check_timeouts(void);
|
||||||
|
void delete_all_msg(void);
|
||||||
void delete_msg(msg_queue_t *elem);
|
void delete_msg(msg_queue_t *elem);
|
||||||
void drawmsg(void);
|
void drawmsg(void);
|
||||||
void dunst_printf(const char *fmt, ...);
|
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
|
void
|
||||||
delete_msg(msg_queue_t *elem) {
|
delete_msg(msg_queue_t *elem) {
|
||||||
msg_queue_t *cur;
|
msg_queue_t *cur;
|
||||||
@ -380,7 +388,11 @@ handleXEvents(void) {
|
|||||||
break;
|
break;
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
if(ev.xbutton.window == win) {
|
if(ev.xbutton.window == win) {
|
||||||
|
if(ev.xbutton.button == Button1) {
|
||||||
delete_msg(NULL);
|
delete_msg(NULL);
|
||||||
|
} else {
|
||||||
|
delete_all_msg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user