tildearrow / kwin-lowlatency

archived - X11 full-screen unredirection and lots'a settings for KWin
372 stars 10 forks source link

Fix 100% cpu usage when unredirection is turned on. Fixes #95 #103

Closed meganomic closed 3 years ago

meganomic commented 3 years ago

I was hit by #95 so I decided to investigate. Found that it was making massive amounts of calls to updateUnredirectedState(). Like, several million calls. So I moved the timer thingamajig out of that function and into the caller delayedCheckUnredirect() instead. I think the culprit is X11::shouldUnredirect(), which was called before the timer code. If not that then some other thing in that line.

It seems to work correctly but I'm not sure how to actually test if a window is unredirected or not so maybe I broke something. Would appreciate if some people would test it out. And if anyone knows, please tell me how to test if a window in redirected or not :D

DarkWav commented 3 years ago

Even though I don't use advanced kwin functionality and haven't had this bug happening to me so far, I'll happily test for side effects on normal usage. In case anyone else wants to test on Arch Linux, I've attached the build files. kwin-lowlatency-cpufix.zip

DarkWav commented 3 years ago

I tested this for approx. 2 hours within normal desktop usage and it didn't cause any problems for me, but perhaps more testing might be required.

DarkWav commented 3 years ago

I should also note that the patch does not work for me, switching to a TTY still puts 1 core at 100%.