Window resizing jitter strangeness

Hi all. Im having a strange issue with jitter when resizing my window. As a minimal example, I’ve just drawn a triangle in opengl and I call glViewport with updated window dimensions whenever the window is resized. Its hard to describe the effect, but you can see the triangle edges ‘bounce’ as the window is being resized: http://a.pomf.se/lvqwcr.webm. Please note that any tearing you see is an artifact of the video and its not something I see on the screen. The code is here: https://gist.github.com/anonymous/185a9bc9e89f15e59c92

The effect seems to go away if I disable vsync and just render (draw calls+SDL_GL_SwapWindow()) as fast as possible. All other combinations I’ve tried (vsync with intervals 1 or 2 and/or rendering with a timer instead of as fast as possible) introduce the jitter as shown in the video.

I’m on Linux, using the proprietary Nvidia drivers and the Gnome desktop with x11. Does anyone know why this issue might be occurring or things I could try to fix it?

typo: The video URL shouldn’t have a period at the end!