rename gtkVersionMinimum->gtkVersionAtLeast for consistency

This commit is contained in:
Jeffrey C. Ollie
2024-08-07 13:12:22 -05:00
committed by Mitchell Hashimoto
parent b6c943386c
commit bbb204ac85
2 changed files with 4 additions and 3 deletions

View File

@ -21,7 +21,8 @@ const ClipboardConfirmationWindow = @import("ClipboardConfirmationWindow.zig");
const ResizeOverlay = @import("ResizeOverlay.zig"); const ResizeOverlay = @import("ResizeOverlay.zig");
const inspector = @import("inspector.zig"); const inspector = @import("inspector.zig");
const gtk_key = @import("key.zig"); const gtk_key = @import("key.zig");
const c = @import("c.zig").c; const cpkg = @import("c.zig");
const c = cpkg.c;
const x11 = @import("x11.zig"); const x11 = @import("x11.zig");
const log = std.log.scoped(.gtk_surface); const log = std.log.scoped(.gtk_surface);
@ -823,7 +824,7 @@ pub fn shouldClose(self: *const Surface) bool {
pub fn getContentScale(self: *const Surface) !apprt.ContentScale { pub fn getContentScale(self: *const Surface) !apprt.ContentScale {
const gtk_scale: f32 = scale: { const gtk_scale: f32 = scale: {
if (comptime c.gtkVersionMinimum(4, 12)) { if (comptime cpkg.gtkVersionAtLeast(4, 12)) {
const native = c.gtk_widget_get_native(@ptrCast(self.gl_area)); const native = c.gtk_widget_get_native(@ptrCast(self.gl_area));
const surface = c.gtk_native_get_surface(native); const surface = c.gtk_native_get_surface(native);
break :scale @floatCast(c.gdk_surface_get_scale(surface)); break :scale @floatCast(c.gdk_surface_get_scale(surface));

View File

@ -18,7 +18,7 @@ pub const c = @cImport({
@cInclude("ghostty_gtk_compat.h"); @cInclude("ghostty_gtk_compat.h");
}); });
pub fn gtkVersionMinimum(comptime major: c_int, comptime minor: c_int) bool { pub fn gtkVersionAtLeast(comptime major: c_int, comptime minor: c_int) bool {
return (c.GTK_MAJOR_VERSION > major or return (c.GTK_MAJOR_VERSION > major or
(c.GTK_MAJOR_VERSION == major and c.GTK_MINOR_VERSION >= minor)); (c.GTK_MAJOR_VERSION == major and c.GTK_MINOR_VERSION >= minor));
} }