Closed tonsky closed 2 years ago
I have a poll
-based event loop here that brings background CPU usage down to a nice 0%, and works on whatever I've thrown at it; if that seems like a good way to go forward, I can PR that.
I will need some time to restore the context back, will take a look. @Alex2772 what do you think?
IMHO the solution is quite elegant except it's hard to understand the magic of the buffer size.
PR is welcome!
The pipe should only ever have a maximum of 2 characters in it, so a buffer size of two should be technically fine. Nevertheless I made it somewhat bigger just in case (don't want to use too much stack though); I'll add some comments & PR tomorrow
https://github.com/JetBrains/JWM/blob/c6762d5c61a8cb06dae5023ca43ddd43b87698cf/linux/cc/WindowManagerX11.cc#L195
Problem:
Ideas: