Draft: Three X11 WSI fixes
These get progressively harder. First one fixes a corner case where destroying a swapchain would cause a round-trip. Second one should make resizing catch up slightly faster.
The third one is a doozy. Previously the WSI queue thread managed both a present and an acquire queue. This is super fragile because there's two ways it can block, either in wsi_queue_pull
(pthread condition wait) or in xcb_wait_for_special_event
(poll), so deadlocks are possible. It's also bogus conceptually, because AcquireNextImage is explicitly the place to block the app, it even specifies what to do on timeout. So this change basically removes the acquire queue entirely and uses the existing "poll" infrastructure for fifo modes too. It also means we only ever call xcb_wait_for_special_event
when the app really wants to wait forever.
Review greatly appreciated, particularly the third one. I'm certain it's the right idea, but I would be surprised if it was perfect.