mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
Dont request sRGB surfaces on Wayland
Apparently mesa just completely broke it. Besides it being already broken on NVIDIA. Sigh, more of my life wasted on Wayland. See https://github.com/kovidgoyal/kitty/issues/7174#issuecomment-2000033873
This commit is contained in:
@@ -38,10 +38,6 @@ check_for_gl_error(void UNUSED *ret, const char *name, GLADapiproc UNUSED funcpt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_nvidia = false;
|
|
||||||
|
|
||||||
bool is_nvidia_gpu_driver(void) { return is_nvidia; }
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gl_init(void) {
|
gl_init(void) {
|
||||||
static bool glad_loaded = false;
|
static bool glad_loaded = false;
|
||||||
@@ -64,7 +60,6 @@ gl_init(void) {
|
|||||||
int gl_major = GLAD_VERSION_MAJOR(gl_version);
|
int gl_major = GLAD_VERSION_MAJOR(gl_version);
|
||||||
int gl_minor = GLAD_VERSION_MINOR(gl_version);
|
int gl_minor = GLAD_VERSION_MINOR(gl_version);
|
||||||
const char *gvs = (const char*)glGetString(GL_VERSION);
|
const char *gvs = (const char*)glGetString(GL_VERSION);
|
||||||
if (strstr(gvs, "NVIDIA")) is_nvidia = true;
|
|
||||||
if (global_state.debug_rendering) printf("GL version string: '%s' Detected version: %d.%d\n", gvs, gl_major, gl_minor);
|
if (global_state.debug_rendering) printf("GL version string: '%s' Detected version: %d.%d\n", gvs, gl_major, gl_minor);
|
||||||
if (gl_major < OPENGL_REQUIRED_VERSION_MAJOR || (gl_major == OPENGL_REQUIRED_VERSION_MAJOR && gl_minor < OPENGL_REQUIRED_VERSION_MINOR)) {
|
if (gl_major < OPENGL_REQUIRED_VERSION_MAJOR || (gl_major == OPENGL_REQUIRED_VERSION_MAJOR && gl_minor < OPENGL_REQUIRED_VERSION_MINOR)) {
|
||||||
fatal("OpenGL version is %d.%d, version >= 3.3 required for kitty", gl_major, gl_minor);
|
fatal("OpenGL version is %d.%d, version >= 3.3 required for kitty", gl_major, gl_minor);
|
||||||
|
|||||||
@@ -56,4 +56,3 @@ void bind_vao_uniform_buffer(ssize_t vao_idx, size_t bufnum, GLuint block_index)
|
|||||||
void unbind_vertex_array(void);
|
void unbind_vertex_array(void);
|
||||||
void unbind_program(void);
|
void unbind_program(void);
|
||||||
GLuint compile_shaders(GLenum shader_type, GLsizei count, const GLchar * const * string);
|
GLuint compile_shaders(GLenum shader_type, GLsizei count, const GLchar * const * string);
|
||||||
bool is_nvidia_gpu_driver(void);
|
|
||||||
|
|||||||
@@ -1077,7 +1077,10 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) {
|
|||||||
// Request SRGB output buffer
|
// Request SRGB output buffer
|
||||||
// Prevents kitty from starting on Wayland + NVIDIA, sigh: https://github.com/kovidgoyal/kitty/issues/7021
|
// Prevents kitty from starting on Wayland + NVIDIA, sigh: https://github.com/kovidgoyal/kitty/issues/7021
|
||||||
// Remove after https://github.com/NVIDIA/egl-wayland/issues/85 is fixed.
|
// Remove after https://github.com/NVIDIA/egl-wayland/issues/85 is fixed.
|
||||||
if (!global_state.is_wayland || !is_nvidia_gpu_driver()) glfwWindowHint(GLFW_SRGB_CAPABLE, true);
|
// Also apparently mesa has introduced a bug with sRGB surfaces and Wayland.
|
||||||
|
// Sigh. Wayland is such a pile of steaming crap.
|
||||||
|
// See https://github.com/kovidgoyal/kitty/issues/7174#issuecomment-2000033873
|
||||||
|
if (!global_state.is_wayland) glfwWindowHint(GLFW_SRGB_CAPABLE, true);
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
cocoa_set_activation_policy(OPT(macos_hide_from_tasks));
|
cocoa_set_activation_policy(OPT(macos_hide_from_tasks));
|
||||||
glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, true);
|
glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user