diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index d194f566..36b888bd 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -97,6 +97,16 @@ struct Inst LG_FontObj fontObj; }; +static bool egl_vsync_option_validator(struct Option * opt, const char ** error) +{ + if (opt->value.x_bool && getenv("WAYLAND_DISPLAY")) + { + DEBUG_WARN("Cannot disable vsync on Wayland, forcing egl:vsync=off"); + opt->value.x_bool = false; + } + + return true; +} static struct Option egl_options[] = { @@ -105,7 +115,8 @@ static struct Option egl_options[] = .name = "vsync", .description = "Enable vsync", .type = OPTION_TYPE_BOOL, - .value.x_bool = false + .value.x_bool = false, + .validator = &vsync_option_validator }, { .module = "egl", diff --git a/client/renderers/OpenGL/opengl.c b/client/renderers/OpenGL/opengl.c index a00f46ae..f99fbf8d 100644 --- a/client/renderers/OpenGL/opengl.c +++ b/client/renderers/OpenGL/opengl.c @@ -48,6 +48,17 @@ Place, Suite 330, Boston, MA 02111-1307 USA #define FADE_TIME 1000000 +static bool opengl_vsync_option_validator(struct Option * opt, const char ** error) +{ + if (opt->value.x_bool && getenv("WAYLAND_DISPLAY")) + { + DEBUG_WARN("Cannot disable vsync on Wayland, forcing opengl:vsync=off"); + opt->value.x_bool = false; + } + + return true; +} + static struct Option opengl_options[] = { { @@ -62,7 +73,8 @@ static struct Option opengl_options[] = .name = "vsync", .description = "Enable vsync", .type = OPTION_TYPE_BOOL, - .value.x_bool = false + .value.x_bool = false, + .validator = &vsync_option_validator }, { .module = "opengl",