We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 237d323 commit f65c764Copy full SHA for f65c764
src/macos/window.rs
@@ -149,12 +149,22 @@ impl<'a> Window<'a> {
149
panic!("Not a macOS window");
150
};
151
152
+ let parent_window = if !handle.ns_window.is_null() {
153
+ handle.ns_window as *mut Object
154
+ } else {
155
+ let parent_view = handle.ns_view as id;
156
+ unsafe {
157
+ let window: id = msg_send![parent_view, window];
158
+ window as *mut Object
159
+ }
160
+ };
161
+
162
let ns_view = unsafe { create_view(&options) };
163
164
let window_inner = WindowInner {
165
open: Cell::new(true),
166
ns_app: Cell::new(None),
- ns_window: Cell::new(None),
167
+ ns_window: Cell::new(Some(parent_window)),
168
ns_view,
169
170
#[cfg(feature = "opengl")]
0 commit comments