mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-17 11:50:26 +03:00
feat(core): Implement HasDisplayHandle for Window (#9214)
This commit is contained in:
parent
43230cb6b7
commit
75f5cb4015
5
.changes/core-window-hasdisplayhandle.md
Normal file
5
.changes/core-window-hasdisplayhandle.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
tauri: 'patch:enhance'
|
||||
---
|
||||
|
||||
`tauri::Window` and `tauri::WebviewWindow` now implement `raw_window_handle::HasDisplayHandle`.
|
@ -876,6 +876,14 @@ impl<R: Runtime> raw_window_handle::HasWindowHandle for WebviewWindow<R> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: Runtime> raw_window_handle::HasDisplayHandle for WebviewWindow<R> {
|
||||
fn display_handle(
|
||||
&self,
|
||||
) -> std::result::Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||
self.webview.app_handle.display_handle()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de, R: Runtime> CommandArg<'de, R> for WebviewWindow<R> {
|
||||
/// Grabs the [`Window`] from the [`CommandItem`]. This will never fail.
|
||||
fn from_command(command: CommandItem<'de, R>) -> Result<Self, InvokeError> {
|
||||
|
@ -885,6 +885,14 @@ impl<R: Runtime> raw_window_handle::HasWindowHandle for Window<R> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: Runtime> raw_window_handle::HasDisplayHandle for Window<R> {
|
||||
fn display_handle(
|
||||
&self,
|
||||
) -> std::result::Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||
self.app_handle.display_handle()
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: Runtime> Clone for Window<R> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
|
Loading…
Reference in New Issue
Block a user