Skip to content

Comment on I found an 8 years old bug in Xorg

Comments

Basically when a window is created, we receive an event. After getting that event, we lock the X server, then ask it about the new window. And sometimes, the window is just not there

Relying on this sounds like a race condition even if the lock is working. In the time between you process the event and getting the lock, the window could have been destroyed.

I don't know if it is sufficient to prevent the race, but the article does mention that they check for DestroyNotify events after the grab.

Ooh, that sounds good. I must have missed that part.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.