diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-18 12:22:17 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-18 12:43:24 -0700 |
| commit | f0a0333bc0ab285de372ab1f218296b1954650d7 (patch) | |
| tree | 435562d3c8090aae7cf3577e46feef706bd5b1d2 /src/App.zig | |
| parent | 2ab5d3cd816645e967622e3e061ef57cb206e6e6 (diff) | |
apprt/gtk-ng: hook up surface render
Diffstat (limited to 'src/App.zig')
| -rw-r--r-- | src/App.zig | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/App.zig b/src/App.zig index 28539c557..c4c7ad55b 100644 --- a/src/App.zig +++ b/src/App.zig @@ -260,7 +260,7 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void { .new_window => |msg| try self.newWindow(rt_app, msg), .close => |surface| self.closeSurface(surface), .surface_message => |msg| try self.surfaceMessage(msg.surface, msg.message), - .redraw_surface => |surface| self.redrawSurface(rt_app, surface), + .redraw_surface => |surface| try self.redrawSurface(rt_app, surface), .redraw_inspector => |surface| self.redrawInspector(rt_app, surface), // If we're quitting, then we set the quit flag and stop @@ -286,9 +286,26 @@ pub fn focusSurface(self: *App, surface: *Surface) void { self.focused_surface = surface; } -fn redrawSurface(self: *App, rt_app: *apprt.App, surface: *apprt.Surface) void { +fn redrawSurface( + self: *App, + rt_app: *apprt.App, + surface: *apprt.Surface, +) !void { if (!self.hasRtSurface(surface)) return; - rt_app.redrawSurface(surface); + + // TODO: Remove this in a separate PR. We should transition to + // the `render` apprt action completely. This is only to make + // our initial gtk-ng work touch less things. + if (@hasDecl(apprt.App, "redrawSurface")) { + rt_app.redrawSurface(surface); + return; + } + + _ = try rt_app.performAction( + .{ .surface = surface.core() }, + .render, + {}, + ); } fn redrawInspector(self: *App, rt_app: *apprt.App, surface: *apprt.Surface) void { |
