Skip to content

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

@DragonSWDev

Description

@DragonSWDev

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions