don't require runtimes to implement all callbacks

This commit is contained in:
Mitchell Hashimoto
2023-02-25 10:32:27 -08:00
parent aa2d3720b6
commit e4c91d2328

View File

@ -917,8 +917,17 @@ pub fn keyCallback(
}, .{ .instant = {} }); }, .{ .instant = {} });
}, },
.previous_tab => self.rt_surface.gotoPreviousTab(), .previous_tab => {
.next_tab => self.rt_surface.gotoNextTab(), if (@hasDecl(apprt.Surface, "gotoPreviousTab")) {
self.rt_surface.gotoPreviousTab();
} else log.warn("runtime doesn't implement gotoPreviousTab", .{});
},
.next_tab => {
if (@hasDecl(apprt.Surface, "gotoNextTab")) {
self.rt_surface.gotoNextTab();
} else log.warn("runtime doesn't implement gotoNextTab", .{});
},
.close_window => { .close_window => {
_ = self.app_mailbox.push(.{ .close = self }, .{ .instant = {} }); _ = self.app_mailbox.push(.{ .close = self }, .{ .instant = {} });