Re: Frame synchronization
Sam Varshavchik <[email protected]> Tue, 19 Feb 2019 17:55:40 -0500
| Newsgroups | gmane.comp.freedesktop.xcb |
|---|---|
| Message-ID | <[email protected]> |
VaL writes: > If we continuously update content of the window (e.g. showing an animation), > and this window is being resizing at the same time, > does it mean, that we do NOT have a control to sync our flushing and > resizing? > Because _NET_WM_SYNC_REQUEST event is not received yet or it is in event > queue but the geometry is already changed? > And we update the window with old geometry before we handle the sync request. > > Using the extended sync, will WM reconfigure the window after it "receives" > updated sync req counter (with odd value)? > And should not change the geometry in other cases. > Or is it the same as basic, when after sync req is sent, then the window > gets resized? Theoretically, the extended synchronization options would allow these situations to be handled intelligently. The window manager knows that it wants to resize the window, and knows that the client supports the extended synchronization protocol. So, after making the decision that the window needs to be resized, the window manager sends _NET_WM_SYNC_REQUEST followed by immediate window resize; and then stops updating the real window, from the redirected buffer, until the client receives the message, subsequent ConfigureNotify and Exposure events, redraws its window, and sets its timer to what it received in _NET_WM_SYNC_REQUEST, ignoring any interim updates. The key word in the above paragraph is "theoretically". And no matter what you do. No matter how much you bend over backwards, there is absolutely nothing you can do about core fundamental ways in which X works. There is nothing you can do about the fact that the X server will, at some point, resize the actual window, and send you the requisite configure and exposure events, but you haven't received them yet, and you're still spewing out rendering messages that update the window whose size is now different. And you have no way of determining that. As far as I can see, extended synchronization seems to have a theoretical ability to solve this problem. In theory, as far as I understand the extended synchronization spec, the window manager effectively intercepts and redirects all client rendering; the window manager knows that it's going to resize the window, so it can stop updating the real window from the off- screen buffer that the client is updating, until the client acknowledged, via the timer update, that it is now aware of the new window size and has updating the redirected off-screen buffer's contents with what the window should have, in its new size. But, all of that ass-umes that this is how the window manager, and the client, work, and they work correctly in all respects. > Could the extended sync method be a solution for these continuous updates? Sure, theoretically it can. Whether it will in practice, is unknown. If your specific window manager does this, and does this correctly, great. You found a solution. But for yourself only. But you have no guarantee that everyone's window manager implements extended synchronization. I know that XFCE's window manager does not. You have no guarantees that your window manager supports even basic synchronization, actually. If your intent is for things to work well in every possible situation, you'll have to make the best job you can, and I don't see a guaranteed way to avoid some display artifacts, in all situations. > I've tried to use extended version, but unfortunately the same issue, when > the updates are done only after sending req counter, like > <- sync req counter is received from WM > -> increased, means begin frame > .. update > -> increased, end frame. > .. update > > <- sync req counter is received > > If no second update, everything is ok. It's hard to say anything here. The devil is in the details. Now, without having the extended specs in front of me, I'm pretty sure you have to increase the counter again, before rendering the next frame, and coordinate the incrementating using _NET_WM_FRAME_DRAWN messages. That is, after marking the end of the frame, you're not supposed to do anything until you get a _NET_WM_FRAME_DRAWN. Then you increment the counter, render your frame, increment the counter again, and then wait for another _NET_WM_FRAME_DRAWN, and so on. I haven't had the need to use extended synchronization (and I couldn't since the window manager I use doesn't implement it), so I might be wrong on some aspect of this, but this was I thought the process was, when I read through it, some time ago. _______________________________________________ Xcb mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/xcb
signature.asc
(application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJcbIlsAAoJEGs6Yr4nnb8l44YQAN+DkY/6SXX7s1lBFdDyIA3y 4678XpbjKCQfnasQgqQ7jyPJZQkF3etYo2IELWUGzTlFKoruWMCwrLWHLXyaZ12B /OI53UJK3TG24/2DBBWVF3z/IqOi5u1VaAL0rc5ajgDUVpdnnkcnpHkNURpjohRL Q/HvdttHD37n3qzV57lLyU9PO+MddXSFrzwgUaFAro2I8sMvIHlHQXck7ng/W7us 6uBgPgOwk3hkEu1CJexe69YhFKXl09AoMD63lKLiywqwv+qTecK5/ip018da1P8B 9t3ZqBm5oLPftaKMM6BP2iSTaM3ehdgt877CUNttxHeV7zpEFrc24IZtsIDF/EIV +oSm6GzqQmDoNCf46xOZAVN71TukX76n5bDHst5XJOeAeyZaR14d5F9nsFXRF+Ru WCAyjyoB/bkRvQYME99SttqtmWPFk0KXyAqkt//WVAqFnC8oWRzpx8JRLBTA9NoK FtzxRS/ftFTE1/SLSQ0tnput5GmULBuJnr0KCzLKsgVa/6QEssLg8Wp64/Kp/qjg Yoyd4w0w1cbg2l01aRm2TpSOr5csT6bV7Bnc2is6FKiKkpl9jvYO/yXX7mitp36W YtbddZZxiWBZBhGgdxi3TSh9ydCCg14wlH7ETJC+jrlPUb2Ew31K4JXFtXoc9mgu te5Ss8UeuHRXxbuLBYPf =Ycli -----END PGP SIGNATURE-----