<div dir="ltr"><div>As I understand, in general, you:</div><div>1. Report to WM that you're going to receive _NET_WM_SYNC_REQUEST event.</div><div>2. Create a synchronization counter.</div><div>3. In the event loop:</div><div>- on _NET_WM_SYNC_REQUEST, set the counter to a given value.</div><div>- on XCB_CONFIGURE_NOTIFY (which may be the resizing event), paint to the back buffer and increase the counter by 1.</div><div>- on XCB_EXPOSE, swap the buffers and increase the counter by 1.</div><div><br></div><div>The three events I've mentioned are sent to your program sequentially in the same order as I listed.</div><div><br></div><div>Increasing the counter points out to WM the drawing state.</div><div>In the sync request event an even value is given.</div><div>When you increase by 1, it becomes odd. This points out that WM should not redraw the window on the screen.</div><div>When you increase again, it becomes even. This points out that drawing to the window is done and WM can redraw your window.</div><div>Drawing to the front buffer should happen when the counter is odd.</div><div><br></div><div>However, if you're updating the window continuously, the order of steps may be different. I can't tell.</div><div>As of now, I only have a static scene that is redrawn only when the window is resized.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 6 июн. 2022 г. в 16:50, Carlo Wood <<a href="mailto:carlo@alinoe.com">carlo@alinoe.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 6 Jun 2022 16:39:08 +0300<br>
Марк Лаго́дич <<a href="mailto:lgd.mrk@gmail.com" target="_blank">lgd.mrk@gmail.com</a>> wrote:<br>
<br>
> I was trying to make window resizing in my program just as smooth as<br>
> in GTK programs.<br>
> So far I have this:<br>
> <a href="https://github.com/MarkLagodych/xcb-opengl-simple-program" rel="noreferrer" target="_blank">https://github.com/MarkLagodych/xcb-opengl-simple-program</a><br>
<br>
This is interesting; I am just a user, working on a Vulkan engine,<br>
and resizing doesn't look good here: mostly, during resizing the<br>
system is so busy with trying to keep up that the window looks empty<br>
until you stop moving the mouse.<br>
<br>
Can you explain to me in simply English what is the idea behind<br>
what you are doing that makes resize more smooth?<br>
<br>
Carlo<br>
</blockquote></div>