apprt/gtk-ng: template callbacks can't return bool, must be c_int
This fixes the tab bar showing the window controls sometimes.pull/8186/head
parent
8ae72d5f7f
commit
5bf8f12cf0
|
|
@ -222,6 +222,11 @@ pub fn Common(
|
||||||
if (func_ti != .@"fn") {
|
if (func_ti != .@"fn") {
|
||||||
@compileError("bound function must be a function pointer");
|
@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(
|
gtk.Widget.Class.bindTemplateCallbackFull(
|
||||||
|
|
|
||||||
|
|
@ -1054,11 +1054,11 @@ pub const Window = extern struct {
|
||||||
fn closureTitlebarStyleIsTab(
|
fn closureTitlebarStyleIsTab(
|
||||||
_: *Self,
|
_: *Self,
|
||||||
value: TitlebarStyle,
|
value: TitlebarStyle,
|
||||||
) callconv(.c) bool {
|
) callconv(.c) c_int {
|
||||||
return switch (value) {
|
return @intFromBool(switch (value) {
|
||||||
.native => false,
|
.native => false,
|
||||||
.tabs => true,
|
.tabs => true,
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue