diff --git a/src/Surface.zig b/src/Surface.zig index 173edea18..582c6cd71 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -2119,15 +2119,11 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !void } else log.warn("dev mode was not compiled into this binary", .{}), .new_window => { - if (@hasDecl(apprt.Surface, "newWindow")) { - try self.rt_surface.newWindow(); - } else { - _ = self.app_mailbox.push(.{ - .new_window = .{ - .parent = self, - }, - }, .{ .instant = {} }); - } + _ = self.app_mailbox.push(.{ + .new_window = .{ + .parent = self, + }, + }, .{ .instant = {} }); }, .new_tab => { diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index fc1a22ed2..c298c4b9b 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -151,6 +151,17 @@ pub const App = struct { _ = surface; // No-op, we use a threaded interface so we're constantly drawing. } + + pub fn newWindow(self: *App, parent: ?*CoreSurface) !void { + _ = self; + + // Right now we only support creating a new window with a parent + // through this code. + // The other case is handled by the embedding runtime. + if (parent) |surface| { + try surface.rt_surface.newWindow(); + } + } }; pub const Surface = struct {