apprt/embedded: add occlusion state callback

This commit is contained in:
Mitchell Hashimoto
2024-02-12 13:48:09 -08:00
parent f115e257a4
commit be0595d71d
3 changed files with 412 additions and 339 deletions

View File

@@ -945,6 +945,13 @@ pub const Surface = struct {
};
}
pub fn occlusionCallback(self: *Surface, visible: bool) void {
self.core_surface.occlusionCallback(visible) catch |err| {
log.err("error in occlusion callback err={}", .{err});
return;
};
}
pub fn gotoTab(self: *Surface, n: usize) void {
const func = self.app.opts.goto_tab orelse {
log.info("runtime embedder does not goto_tab", .{});
@@ -1546,6 +1553,11 @@ pub const CAPI = struct {
surface.focusCallback(focused);
}
/// Update the occlusion state of a surface.
export fn ghostty_surface_set_occlusion(surface: *Surface, visible: bool) void {
surface.occlusionCallback(visible);
}
/// Filter the mods if necessary. This handles settings such as
/// `macos-option-as-alt`. The filtered mods should be used for
/// key translation but should NOT be sent back via the `_key`