s/msgqueuehead/msgqueue

This commit is contained in:
Sascha Kruse 2011-09-12 18:02:55 +02:00
parent 747c90be2d
commit 78ba452469
2 changed files with 13 additions and 13 deletions

22
dunst.c
View File

@ -45,7 +45,7 @@ static Bool topbar = True;
static DC *dc; static DC *dc;
static Window win; static Window win;
static double global_timeout = 10; static double global_timeout = 10;
static msg_queue_t *msgqueuehead = NULL; static msg_queue_t *msgqueue = NULL;
static time_t now; static time_t now;
static int listen_to_dbus = True; static int listen_to_dbus = True;
static int visible = False; static int visible = False;
@ -160,11 +160,11 @@ handleXEvents(void) {
void void
next_win(void) { next_win(void) {
if(msgqueuehead == NULL) { if(msgqueue == NULL) {
return; return;
} }
msgqueuehead = pop(msgqueuehead); msgqueue = pop(msgqueue);
if(msgqueuehead == NULL) { if(msgqueue == NULL) {
/* hide window */ /* hide window */
if(!visible) { if(!visible) {
/* window is already hidden */ /* window is already hidden */
@ -175,7 +175,7 @@ next_win(void) {
XFlush(dc->dpy); XFlush(dc->dpy);
visible = False; visible = False;
} else { } else {
drawmsg(msgqueuehead->msg); drawmsg(msgqueue->msg);
} }
} }
@ -188,9 +188,9 @@ run(void) {
dbus_poll(); dbus_poll();
} }
now = time(&now); now = time(&now);
if(msgqueuehead != NULL) { if(msgqueue != NULL) {
show_win(); show_win();
if(difftime(now, msgqueuehead->start) > global_timeout) { if(difftime(now, msgqueue->start) > global_timeout) {
next_win(); next_win();
} }
handleXEvents(); handleXEvents();
@ -263,7 +263,7 @@ show_win(void) {
/* window is already visible */ /* window is already visible */
return; return;
} }
if(msgqueuehead == NULL) { if(msgqueue == NULL) {
/* there's nothing to show */ /* there's nothing to show */
return; return;
} }
@ -271,7 +271,7 @@ show_win(void) {
XGrabButton(dc->dpy, AnyButton, AnyModifier, win, False, XGrabButton(dc->dpy, AnyButton, AnyModifier, win, False,
BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
XFlush(dc->dpy); XFlush(dc->dpy);
drawmsg(msgqueuehead->msg); drawmsg(msgqueue->msg);
visible = True; visible = True;
} }
@ -315,7 +315,7 @@ main(int argc, char *argv[]) {
else if(!strcmp(argv[i], "-to")) else if(!strcmp(argv[i], "-to"))
global_timeout = atoi(argv[++i]); global_timeout = atoi(argv[++i]);
else if(!strcmp(argv[i], "-msg")) { else if(!strcmp(argv[i], "-msg")) {
msgqueuehead = append(msgqueuehead, argv[++i]); msgqueue = append(msgqueue, argv[++i]);
listen_to_dbus = False; listen_to_dbus = False;
} }
else if(!strcmp(argv[i], "-mon")) { else if(!strcmp(argv[i], "-mon")) {
@ -363,7 +363,7 @@ main(int argc, char *argv[]) {
dc = initdc(); dc = initdc();
initfont(dc, font); initfont(dc, font);
setup(); setup();
if(msgqueuehead != NULL) { if(msgqueue != NULL) {
show_win(); show_win();
} }
run(); run();

View File

@ -47,7 +47,7 @@ dbus_poll(void) {
/* make timeout smaller if we are displaying a message /* make timeout smaller if we are displaying a message
* to improve responsivness for mouse clicks * to improve responsivness for mouse clicks
*/ */
if(msgqueuehead == NULL) { if(msgqueue == NULL) {
dbus_connection_read_write(dbus_conn, DBUS_POLL_TIMEOUT); dbus_connection_read_write(dbus_conn, DBUS_POLL_TIMEOUT);
} else { } else {
dbus_connection_read_write(dbus_conn, 100); dbus_connection_read_write(dbus_conn, 100);
@ -199,7 +199,7 @@ notify(DBusMessage *dmsg) {
sprintf(msg, "%s: %s", appname, summary); sprintf(msg, "%s: %s", appname, summary);
} }
msgqueuehead = append(msgqueuehead, msg); msgqueue = append(msgqueue, msg);
reply = dbus_message_new_method_return(dmsg); reply = dbus_message_new_method_return(dmsg);