UtkarshVerma / dwmblocks-async

An efficient, lean, and asynchronous status feed generator for dwm.
GNU General Public License v2.0
232 stars 87 forks source link

Maximum number of blocks? #5

Closed Pyxels closed 3 years ago

Pyxels commented 3 years ago

Is there a maximum number of displayable blocks? When I use over 10 blocks, the last ones in the list disappear or visually bug into the middle, but are not clickable.

UtkarshVerma commented 3 years ago

I haven't set an upper limit for the number of blocks. But I can reproduce this, which is weird. I'll look into it.

Pyxels commented 3 years ago

Thanks alot I've been staring at the source code for quite a while now xD But I don't have enough knowledge about C to understand it fully.

UtkarshVerma commented 3 years ago

This bug had me down the rabbit hole for the past day. Apparently, the limitation on the number of blocks was being imposed by signal handlers which are threaded, and therefore simultaneous execution limit is dependent on the CPU (my CPU has 4 cores and 2 threads/core). I had to redo the entire design of the code and got rid of using signals wherever I could.

Now dwmblocks-async uses epoll so you can go crazy with the number of blocks! I have fixed this through commit 839ccc5b1d7c44233e7334602717d285cebe2a01. Please test it out and feel free to close the issue if the bug is gone.

You'll have to slightly modify dwm source to support the new changes. https://github.com/UtkarshVerma/dwm/commit/ab805a4429c0aa1ba69520fef7d0fb5bfb8db94f

Pyxels commented 3 years ago

Everything works like a charm! Thank you

Edit: For all those wondering: Im using lukes build of dwm but changing a very similar line (just grep for popen("pidof -s and change that) worked as well.