diff --git a/src/event.c b/src/event.c index 96465e1..e2cec25 100644 --- a/src/event.c +++ b/src/event.c @@ -151,7 +151,7 @@ clientmessageevent(XClientMessageEvent *ev) if(ev->format != 32) return; - for(i = 0; i < net_last; ++i) + for(i = 0; i < net_last + screen_count(); ++i) if(net_atom[i] == ev->message_type) mess_t = i; diff --git a/src/ewmh.c b/src/ewmh.c index ff5ccac..00bcb5d 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -47,7 +47,7 @@ ewmh_init_hints(void) char class[] = "wmfs", st[64]; long pid = (long)getpid(); - net_atom = emalloc(net_last + screen_count() + 1, sizeof(Atom)); + net_atom = emalloc(net_last + screen_count(), sizeof(Atom)); /* EWMH hints */ net_atom[net_supported] = ATOM("_NET_SUPPORTED"); @@ -98,9 +98,8 @@ ewmh_init_hints(void) net_atom[wmfs_statustext + j] = ATOM(st); } - XChangeProperty(dpy, ROOT, net_atom[net_supported], XA_ATOM, 32, - PropModeReplace, (uchar*)net_atom, net_last); + PropModeReplace, (uchar*)net_atom, net_last + screen_count()); XChangeProperty(dpy, ROOT, net_atom[wmfs_running], XA_CARDINAL, 32, PropModeReplace, (uchar*)&i, 1);