-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(core): add mult-window support #1217
Conversation
tauri.conf.json
to multiple windows#[serde(default)] | ||
pub url: WindowUrl, | ||
/// The horizontal position of the window's top left corner | ||
pub x: Option<f64>, |
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 think we should accept usize
for these and convert them to i64 on the wry side. I can't think of a scenario where you'd actually pass a non integer so it makes more sense to accept an integer imo, it will save people from having to add the .0
, which could be confusing for those unfamiliar with Rust and statically typed languages.
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 was just following the wry
interface. We should follow the same convention.
This is the tauri.conf.json
stuff and the deserialization would also work with integers. The only real issue regarding this would be the Rust API to create windows, but I can also change that to accept both usize
and f64
.
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 think that Wry itself should take usize
s, but if Tauri accepts either that's ok too.
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
This PR adds multi-window support to Tauri. Check out the new example:
$ cd tauri $ cargo run --example multiwindow
For now the windows can be configured on
tauri.conf.json
but a Rust API will be provided soon on the AppBuilder struct.The window API will be improved on a subsequent PR, with the event system refactored to simplify multi-window usage and APIs to manipulate the windows.