gtk(bell): use `gdk.Surface.beep` for bell

Co-authored-by: Jeffrey C. Ollie <jeff@ocjtech.us>
pull/7087/head
Leah Amelia Chen 2025-04-14 21:43:02 +08:00
parent a0760cabd6
commit 10a591fba2
No known key found for this signature in database
1 changed files with 8 additions and 0 deletions

View File

@ -2441,5 +2441,13 @@ pub fn setSecureInput(self: *Surface, value: apprt.action.SecureInput) void {
}
pub fn ringBell(self: *Surface) !void {
const window = self.container.window() orelse {
log.warn("failed to ring bell: surface is not attached to any window", .{});
return;
};
// System beep
if (window.window.as(gtk.Native).getSurface()) |surface| {
surface.beep();
}
}