|
@@ -387,6 +387,14 @@ impl<R: Runtime> WindowBuilder<R> {
|
|
self
|
|
self
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// Sets a parent to the window to be created.
|
|
|
|
+ #[cfg(target_os = "macos")]
|
|
|
|
+ #[must_use]
|
|
|
|
+ pub fn parent_window(mut self, parent: *mut std::ffi::c_void) -> Self {
|
|
|
|
+ self.window_builder = self.window_builder.parent_window(parent);
|
|
|
|
+ self
|
|
|
|
+ }
|
|
|
|
+
|
|
/// Set an owner to the window to be created.
|
|
/// Set an owner to the window to be created.
|
|
///
|
|
///
|
|
/// From MSDN:
|
|
/// From MSDN:
|
|
@@ -463,7 +471,7 @@ unsafe impl<R: Runtime> raw_window_handle::HasRawWindowHandle for Window<R> {
|
|
#[cfg(windows)]
|
|
#[cfg(windows)]
|
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
|
let mut handle = raw_window_handle::Win32Handle::empty();
|
|
let mut handle = raw_window_handle::Win32Handle::empty();
|
|
- handle.hwnd = self.hwnd().expect("failed to get window `hwnd`");
|
|
|
|
|
|
+ handle.hwnd = self.hwnd().expect("failed to get window `hwnd`").0 as *mut _;
|
|
raw_window_handle::RawWindowHandle::Win32(handle)
|
|
raw_window_handle::RawWindowHandle::Win32(handle)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -909,13 +917,8 @@ impl<R: Runtime> Window<R> {
|
|
}
|
|
}
|
|
/// Returns the native handle that is used by this window.
|
|
/// Returns the native handle that is used by this window.
|
|
#[cfg(windows)]
|
|
#[cfg(windows)]
|
|
- pub fn hwnd(&self) -> crate::Result<*mut std::ffi::c_void> {
|
|
|
|
- self
|
|
|
|
- .window
|
|
|
|
- .dispatcher
|
|
|
|
- .hwnd()
|
|
|
|
- .map(|hwnd| hwnd.0 as *mut _)
|
|
|
|
- .map_err(Into::into)
|
|
|
|
|
|
+ pub fn hwnd(&self) -> crate::Result<HWND> {
|
|
|
|
+ self.window.dispatcher.hwnd().map_err(Into::into)
|
|
}
|
|
}
|
|
|
|
|
|
/// Returns the `ApplicatonWindow` from gtk crate that is used by this window.
|
|
/// Returns the `ApplicatonWindow` from gtk crate that is used by this window.
|