From 939d1f980bc6ca74f931ac12f8ceb8d3fa1d7908 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Sun, 11 Sep 2011 17:45:20 +0200 Subject: [PATCH] don't grab any key, when -key is not used before this, the NoSymbol keysym was grabbed, which causes a badAccess error on a second instance of dunst if both don't use the -key option. --- dunst.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dunst.c b/dunst.c index 3b9d6c8..2d0ddce 100644 --- a/dunst.c +++ b/dunst.c @@ -248,8 +248,10 @@ setup(void) { CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); /* grab keys */ - code = XKeysymToKeycode(dc->dpy, key); - XGrabKey(dc->dpy, code, mask, root, True, GrabModeAsync, GrabModeAsync); + if(key != NoSymbol) { + code = XKeysymToKeycode(dc->dpy, key); + XGrabKey(dc->dpy, code, mask, root, True, GrabModeAsync, GrabModeAsync); + } } void