mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-19 19:41:27 +00:00
apprt/embedded: add occlusion state callback
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user