mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-09 21:28:26 +00:00
apprt: clean up how apprt initializes surfaces
This commit is contained in:
@@ -129,7 +129,7 @@ pub fn deleteSurface(self: *App, rt_surface: *apprt.Surface) void {
|
||||
|
||||
/// The last focused surface. This is only valid while on the main thread
|
||||
/// before tick is called.
|
||||
pub fn focusedSurface(self: *App) ?*Surface {
|
||||
pub fn focusedSurface(self: *const App) ?*Surface {
|
||||
const surface = self.focused_surface orelse return null;
|
||||
if (!self.hasSurface(surface)) return null;
|
||||
return surface;
|
||||
@@ -214,7 +214,7 @@ fn surfaceMessage(self: *App, surface: *Surface, msg: apprt.surface.Message) !vo
|
||||
// Not a problem.
|
||||
}
|
||||
|
||||
fn hasSurface(self: *App, surface: *Surface) bool {
|
||||
fn hasSurface(self: *const App, surface: *const Surface) bool {
|
||||
for (self.surfaces.items) |v| {
|
||||
if (&v.core_surface == surface) return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user