Partial fix for #1938, add GDK_DEBUG=gl-no-fractional (#4255)

GSK_RENDERER=opengl does not properly handle fractional scaling and thus
we need to set GDK_DEBUG=gl-no-fractional.

Potential fix for #1938
This commit is contained in:
Mitchell Hashimoto
2025-01-02 15:17:25 -08:00
committed by GitHub

View File

@ -111,7 +111,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App {
// From gtk 4.16, GDK_DEBUG is split into GDK_DEBUG and GDK_DISABLE. // From gtk 4.16, GDK_DEBUG is split into GDK_DEBUG and GDK_DISABLE.
// For the remainder of "why" see the 4.14 comment below. // For the remainder of "why" see the 4.14 comment below.
_ = internal_os.setenv("GDK_DISABLE", "gles-api,vulkan"); _ = internal_os.setenv("GDK_DISABLE", "gles-api,vulkan");
_ = internal_os.setenv("GDK_DEBUG", "opengl"); _ = internal_os.setenv("GDK_DEBUG", "opengl,gl-no-fractional");
} else if (version.atLeast(4, 14, 0)) { } else if (version.atLeast(4, 14, 0)) {
// We need to export GDK_DEBUG to run on Wayland after GTK 4.14. // We need to export GDK_DEBUG to run on Wayland after GTK 4.14.
// Older versions of GTK do not support these values so it is safe // Older versions of GTK do not support these values so it is safe
@ -126,7 +126,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App {
// - "vulkan-disable" - disable Vulkan, Ghostty can't use Vulkan // - "vulkan-disable" - disable Vulkan, Ghostty can't use Vulkan
// and initializing a Vulkan context was causing a longer delay // and initializing a Vulkan context was causing a longer delay
// on some systems. // on some systems.
_ = internal_os.setenv("GDK_DEBUG", "opengl,gl-disable-gles,vulkan-disable"); _ = internal_os.setenv("GDK_DEBUG", "opengl,gl-disable-gles,vulkan-disable,gl-no-fractional");
} else { } else {
// Versions prior to 4.14 are a bit of an unknown for Ghostty. It // Versions prior to 4.14 are a bit of an unknown for Ghostty. It
// is an environment that isn't tested well and we don't have a // is an environment that isn't tested well and we don't have a