How does GTK achieve smooth resizing on X11?

I’ve been a Linux user for some time now, and something has always stood out to me: the only X11 applications that update at more than 20hz during resizing are GTK and Qt.

I’m trying to get into programming my own X clients, but this issue is really bugging me. Here’s what I found about my program:

  • When dragging the window to reposition it, my client receives ConfigureNotify events at my screen’s refresh rate.
  • When dragging the window to resize it, my client only gets ConfigureNotify events at ~20hz.

It’s not just me though; Pretty much every non GTK/Qt application (x11-apps, Enlightenment apps, WINE windows, OpenGL games) have this same limitation.

Are there any tricks you guys use to circumvent this issue, or have I improperly structured my event loop?

I’m not an expert on X11, but perhaps with XSync the compositor manages to get better timings? See:

While this did look promising at first, it doesn’t seem to really affect the rate of events.

If I’m correct in assuming that the window manager is fully in charge of issuing resize events, maybe the window manager I’m using (Muffin) is just looking for a specific hint?