rust-windowing/glutin

Enabling v-sync doesn't work on X11 but works on Wayland

DragonSWDev opened this issue · 3 comments

Hello, so basically after creating window surface and context from display I'm enabling or disabling v-sync based on flag passed to the function. Code looks like this:

match vsync_enabled {
            false => gl_surface.set_swap_interval(&gl_context, glutin::surface::SwapInterval::DontWait).unwrap(),
            true => gl_surface.set_swap_interval(&gl_context, glutin::surface::SwapInterval::Wait(NonZeroU32::new(1).unwrap())).unwrap()
        }

it works as expected on Wayland but doesn't work on X11 where v-sync is always disabled. I'm on Fedora 40 with NVIDIA GPU. "Sync to VBlank" option is enabled in NVIDIA Settings. Other OpenGL applications (e.g. glxgears) are running with FPS blocked to refresh rate. Am I missing something?

Are you using EGL or GLX here?

@kchibisov How can I check this?