From 6195422c66d329222f8005efc687840deced6ee7 Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Sat, 15 Dec 2018 11:22:38 +0200 Subject: [PATCH] Swap control only works with OpenGL --- src/compton.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compton.c b/src/compton.c index b3f9f54..5323ae6 100644 --- a/src/compton.c +++ b/src/compton.c @@ -4566,8 +4566,8 @@ static bool vsync_opengl_swc_init(session_t *ps) { #ifdef CONFIG_OPENGL if (!bkend_use_glx(ps)) { - printf_errf("(): I'm afraid OpenGL swap control wouldn't help if you are " - "not using GLX backend. You could try, nonetheless."); + printf_errf("(): OpenGL swap control requires the GLX backend."); + return false; } if (!vsync_opengl_swc_swap_interval(ps, 1)) { @@ -4631,7 +4631,8 @@ vsync_opengl_swc_deinit(session_t *ps) { bool vsync_init(session_t *ps) { // Mesa turns on swap control by default, undo that - vsync_opengl_swc_swap_interval(ps, 0); + if (bkend_use_glx(ps)) + vsync_opengl_swc_swap_interval(ps, 0); if (ps->o.vsync && VSYNC_FUNCS_INIT[ps->o.vsync] && !VSYNC_FUNCS_INIT[ps->o.vsync](ps)) {