-
Notifications
You must be signed in to change notification settings - Fork 120
feat: Window Manager APIs #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ef372fb to
1a18f2d
Compare
e4ae582 to
700e3f7
Compare
nicoburns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments about thread synchronisation. In addition to that, we're hoping to align the API with the one from Dioxus Desktop, so that users could use the same code with either Desktop or Native.
https://docs.rs/dioxus-desktop/latest/dioxus_desktop/fn.use_window.html
https://docs.rs/dioxus-desktop/latest/dioxus_desktop/struct.DesktopService.html#method.new_window
examples/multi_window.rs
Outdated
| let vdom = VirtualDom::new(secondary_window); | ||
| let title = format!("window#{}", counter()); | ||
| let attributes = WindowAttributes::default() | ||
| .with_title(title) | ||
| .with_inner_size(winit::dpi::LogicalSize::new(400.0, 300.0)); | ||
| let receiver = provider.create_document_window(vdom, attributes); | ||
| let mut spawned_windows = spawned_windows.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether create_document_window should accept a "function that returns a VirtualDom" (similar to launch) rather than an already constructed VirtualDom? That might eliminate the thread-safety issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not able to elimate thread-safety issues. It's because BlitzShellEvent::embedder_event still requires Send + Sync
a869957 to
18f4863
Compare
This PR introduces multi-window management and easy to use API and example