mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-05 19:08:17 +00:00
apprt/gtk-ng: template callbacks can't return bool, must be c_int (#8186)
This fixes the tab bar showing the window controls sometimes.
This commit is contained in:
@@ -222,6 +222,11 @@ pub fn Common(
|
||||
if (func_ti != .@"fn") {
|
||||
@compileError("bound function must be a function pointer");
|
||||
}
|
||||
if (func_ti.@"fn".return_type == bool) {
|
||||
// glib booleans are ints and returning a Zig bool type
|
||||
// I think uses a byte and causes ABI issues.
|
||||
@compileError("bound function must return c_int instead of bool");
|
||||
}
|
||||
}
|
||||
|
||||
gtk.Widget.Class.bindTemplateCallbackFull(
|
||||
|
@@ -1054,11 +1054,11 @@ pub const Window = extern struct {
|
||||
fn closureTitlebarStyleIsTab(
|
||||
_: *Self,
|
||||
value: TitlebarStyle,
|
||||
) callconv(.c) bool {
|
||||
return switch (value) {
|
||||
) callconv(.c) c_int {
|
||||
return @intFromBool(switch (value) {
|
||||
.native => false,
|
||||
.tabs => true,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user