From ad4e9bb42c15c308b9c56968dd2e79a430738526 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Dec 2023 13:58:09 +0530 Subject: [PATCH] Add a check that the output buffer is actually sRGB --- kitty/glfw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kitty/glfw.c b/kitty/glfw.c index 7916872004f..d5794c99e80 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1135,7 +1135,11 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) { if (ret == NULL) return NULL; Py_DECREF(ret); get_platform_dependent_config_values(glfw_window); + GLint encoding; + glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK_LEFT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding); + if (encoding != GL_SRGB) log_error("The output buffer does not support sRGB color encoding, colors will be incorrect."); is_first_window = false; + } OSWindow *w = add_os_window(); w->handle = glfw_window;