From 2e9ee1645536fade0a7fdb531b1326055c7b7dff Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 19 Jul 2025 14:03:42 -0700 Subject: [PATCH] core: remove Surface.shouldClose This was a noop in all of our apprts and I think is a holdover from the glfw days. --- src/App.zig | 12 ------------ src/apprt/embedded.zig | 9 --------- src/apprt/gtk-ng/Surface.zig | 5 ----- src/apprt/gtk/Surface.zig | 9 --------- 4 files changed, 35 deletions(-) diff --git a/src/App.zig b/src/App.zig index effef0c5f..69667dcb9 100644 --- a/src/App.zig +++ b/src/App.zig @@ -132,18 +132,6 @@ pub fn destroy(self: *App) void { /// events. This should be called by the application runtime on every loop /// tick. pub fn tick(self: *App, rt_app: *apprt.App) !void { - // If any surfaces are closing, destroy them - var i: usize = 0; - while (i < self.surfaces.items.len) { - const surface = self.surfaces.items[i]; - if (surface.shouldClose()) { - surface.close(false); - continue; - } - - i += 1; - } - // Drain our mailbox try self.drainMailbox(rt_app); } diff --git a/src/apprt/embedded.zig b/src/apprt/embedded.zig index c21f57ffb..bd1ffd460 100644 --- a/src/apprt/embedded.zig +++ b/src/apprt/embedded.zig @@ -705,15 +705,6 @@ pub const Surface = struct { ); } - pub fn setShouldClose(self: *Surface) void { - _ = self; - } - - pub fn shouldClose(self: *const Surface) bool { - _ = self; - return false; - } - pub fn getCursorPos(self: *const Surface) !apprt.CursorPos { return self.cursor_pos; } diff --git a/src/apprt/gtk-ng/Surface.zig b/src/apprt/gtk-ng/Surface.zig index 71e57a1bc..0b69dd529 100644 --- a/src/apprt/gtk-ng/Surface.zig +++ b/src/apprt/gtk-ng/Surface.zig @@ -30,11 +30,6 @@ pub fn close(self: *Self, process_active: bool) void { _ = process_active; } -pub fn shouldClose(self: *Self) bool { - _ = self; - return false; -} - pub fn getTitle(self: *Self) ?[:0]const u8 { _ = self; return null; diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index d3849781f..43e378487 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -877,15 +877,6 @@ pub fn controlInspector( }; } -pub fn setShouldClose(self: *Surface) void { - _ = self; -} - -pub fn shouldClose(self: *const Surface) bool { - _ = self; - return false; -} - pub fn getContentScale(self: *const Surface) !apprt.ContentScale { const gtk_scale: f32 = scale: { const widget = self.gl_area.as(gtk.Widget);