Thanks for working on this. I tried building with that patch, and had problems because your email client munged the patch. I cleaned it up by hand and arrived at the attached patch instead. (It needs a better commit message of course.) Maybe next time you could attach the output of git-format-patch. Although the resulting system builds under Fedora 24 x86-64 with GTK, I can't tell any difference in flickering. I don't see much flicker without the patch, or with it. (I am using X, not Wayland.) Maybe my eyes are not good enough.... I don't see the need to expose double-buffering to Lisp via x-double-buffered-p or inhibit-double-buffering. Unless there's a demonstrated need, I'd remove these from the Lisp interface, to simplify it. The configure.ac change should use AC_CACHE_CHECK. set_up_x_back_buffer should be a static function, since it's not used outside its module. In C code we typically use comment /* like this */, not // like this. Also, the spacing for pointer decls is typically 'type *id', not 'type * id' or 'type* id'. You can assume C99 for loop control, e.g., 'for (int i = 0; i < n; i++) ...'. Thanks again.