mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-18 19:11:20 +00:00
apprt/embedded: fix initialization on macOS
This commit is contained in:
@@ -283,14 +283,14 @@ pub const Surface = struct {
|
||||
inspector: ?*Inspector = null,
|
||||
|
||||
pub const Options = extern struct {
|
||||
/// Userdata passed to some of the callbacks.
|
||||
userdata: ?*anyopaque = null,
|
||||
|
||||
/// The platform that this surface is being initialized for and
|
||||
/// the associated platform-specific configuration.
|
||||
platform_tag: c_int = 0,
|
||||
platform: Platform.C = undefined,
|
||||
|
||||
/// Userdata passed to some of the callbacks.
|
||||
userdata: ?*anyopaque = null,
|
||||
|
||||
/// The scale factor of the screen.
|
||||
scale_factor: f64 = 1,
|
||||
|
||||
|
||||
@@ -466,7 +466,9 @@ pub fn finalizeSurfaceInit(self: *const Metal, surface: *apprt.Surface) !void {
|
||||
},
|
||||
|
||||
apprt.embedded => .{
|
||||
.view = surface.nsview,
|
||||
.view = switch (surface.platform) {
|
||||
.macos => |v| v.nsview,
|
||||
},
|
||||
.scaleFactor = @floatCast(surface.content_scale.x),
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user