Skip to content

Commit 31ccb0b

Browse files
committed
Fix setDelegate call
1 parent 4cabe2f commit 31ccb0b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/macos/window.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::rc::Rc;
77
use keyboard_types::KeyboardEvent;
88
use objc2::rc::Retained;
99
use objc2::runtime::NSObjectProtocol;
10-
use objc2::{MainThreadMarker, MainThreadOnly};
10+
use objc2::{msg_send, MainThreadMarker, MainThreadOnly};
1111
use objc2_app_kit::{
1212
NSApplication, NSApplicationActivationPolicy, NSBackingStoreType, NSEvent, NSPasteboard,
1313
NSPasteboardTypeString, NSView, NSWindow, NSWindowStyleMask,
@@ -262,8 +262,7 @@ impl<'a> Window<'a> {
262262
let _ = Self::init(window_inner, window_info, build);
263263

264264
ns_window.setContentView(Some(&ns_view));
265-
// TODO: this was here before, but couldn't have worked??
266-
//ns_window.setDelegate(Some(&ns_view));
265+
let () = unsafe { msg_send![&*ns_window, setDelegate: &*ns_view] };
267266

268267
app.run();
269268
}

0 commit comments

Comments
 (0)