-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[bug] Incorrect and inconsistent window positions #10021
Labels
Comments
thewh1teagle
added
status: needs triage
This issue needs to triage, applied to new issues
type: bug
labels
Jun 8, 2024
It may look like: let mut position = window.outer_position().unwrap();
println!("Physical position: {:?}", position);
position.x += 30;
position.y += 30;
let logical_position = position.to_logical::<f64>(window.scale_factor().unwrap());
println!("Logical position: {:?}", &logical_position);
let _window =
WebviewWindowBuilder::new(&app_handle, "main1", WebviewUrl::App("/index.html".into()))
.position(logical_position.x as f64, logical_position.y as f64) // 30px offset x+y
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
I use tauri on v2 project on
macOS
When creating new window with specific position, the position is incorrect and inconsistent comparing of doing it with global tauri.
Reproduction
Example on Rust side, it creates the window with invalid offset.
Example correct position using global tauri:
Expected behavior
The window should be created with offset of 30px on x,y
Full
tauri info
outputStack trace
No response
Additional context
window.outer_position
returnsPhysicalPosition<i32>
whileWebviewWindowBuilder::new().position()
expectsf64
window.set_position(position);
right after creating it move it to correct positionThe text was updated successfully, but these errors were encountered: