Skip to content

Commit 702936d

Browse files
committed
macos: add FullSizeContentView
1 parent 0ec01e2 commit 702936d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/backends/macos/AppKit.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub const NSWindowStyleMask = struct {
99
pub const Resizable: NSUInteger = 1 << 3;
1010
pub const Utility: NSUInteger = 1 << 4;
1111
pub const FullScreen: NSUInteger = 1 << 14;
12+
pub const FullSizeContentView: NSUInteger = 1 << 15;
1213
};
1314

1415
pub const NSBackingStore = enum(NSUInteger) {

src/backends/macos/backend.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub const Window = struct {
109109
pub fn create() BackendError!Window {
110110
const NSWindow = objc.getClass("NSWindow") catch return BackendError.InitializationError;
111111
const rect = objc.NSRect.make(100, 100, 200, 200);
112-
const style = AppKit.NSWindowStyleMask.Titled | AppKit.NSWindowStyleMask.Closable | AppKit.NSWindowStyleMask.Miniaturizable | AppKit.NSWindowStyleMask.Resizable;
112+
const style = AppKit.NSWindowStyleMask.Titled | AppKit.NSWindowStyleMask.Closable | AppKit.NSWindowStyleMask.Miniaturizable | AppKit.NSWindowStyleMask.Resizable | AppKit.NSWindowStyleMask.FullSizeContentView;
113113

114114
std.log.info("make new rect", .{});
115115
const newRect = objc.msgSendByName(objc.NSRect, NSWindow, "frameRectForContentRect:styleMask:", .{ rect, style }) catch unreachable;
@@ -160,6 +160,7 @@ pub const Window = struct {
160160

161161
pub fn show(self: *Window) void {
162162
std.log.info("show window", .{});
163+
objc.msgSendByName(void, self.peer, "setIsVisible:", .{ @as(objc.id, self.peer), @as(u8, @intFromBool(true))}) catch unreachable;
163164
objc.msgSendByName(void, self.peer, "makeKeyAndOrderFront:", .{@as(objc.id, self.peer)}) catch unreachable;
164165
std.log.info("showed window", .{});
165166
_ = activeWindows.fetchAdd(1, .Release);

0 commit comments

Comments
 (0)