From 093bdf640a434ea1f22e50236e2f44f727c83e75 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Tue, 7 Jan 2025 19:53:27 +0000 Subject: [PATCH] apprt/gtk: Move most version checks to runtime Unless we are guarding against symbols added in new versions we now check against the runtime version of GTK to handle them even when we didn't build against that version. --- src/apprt/gtk/App.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 3cc1782c8..993dfcc32 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -111,12 +111,12 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { // Disabling Vulkan can improve startup times by hundreds of // milliseconds on some systems. We don't use Vulkan so we can just // disable it. - if (version.atLeast(4, 16, 0)) { + if (version.runtimeAtLeast(4, 16, 0)) { // 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. _ = internal_os.setenv("GDK_DISABLE", "gles-api,vulkan"); _ = internal_os.setenv("GDK_DEBUG", "opengl,gl-no-fractional"); - } else if (version.atLeast(4, 14, 0)) { + } else if (version.runtimeAtLeast(4, 14, 0)) { // 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 // to always set this. Forwards versions are uncertain so we'll have to @@ -138,7 +138,7 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { _ = internal_os.setenv("GDK_DEBUG", "vulkan-disable"); } - if (version.atLeast(4, 14, 0)) { + if (version.runtimeAtLeast(4, 14, 0)) { // We need to export GSK_RENDERER to opengl because GTK uses ngl by // default after 4.14 _ = internal_os.setenv("GSK_RENDERER", "opengl"); @@ -1028,7 +1028,7 @@ fn loadRuntimeCss( , .{ .font_family = font_family }); } - if (version.atLeast(4, 16, 0)) { + if (version.runtimeAtLeast(4, 16, 0)) { switch (window_theme) { .ghostty => try writer.print( \\:root {{