Skip to content

WebviewWindow doesn't adhere to x,y on Mac #1023

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

Open
someone2080 opened this issue Dec 8, 2024 · 2 comments
Open

WebviewWindow doesn't adhere to x,y on Mac #1023

someone2080 opened this issue Dec 8, 2024 · 2 comments

Comments

@someone2080
Copy link

Describe the bug
Bug is very similar to 11430

Reproduction

When I try to create a new window using WebviewWindow with x,y options, the newly created Window appears on the Display, based on the x,y coordinates, but then jumps to the primary Display. I have to use setPosition method to move it to the right Display.

This behavior can be fixed with setPosition, ex: await webview.setPosition(position), but the workaround won't work if the screens have different scale/ratio, see image:

Screenshot 2024-12-08 at 4 27 20 PM Screenshot 2024-12-08 at 4 28 16 PM
@someone2080
Copy link
Author

Hey guys, are there any updates on this one? This is a regression from Tauri 1. I wish I could fix it myself, but I'm still learning Rust...

@someone2080
Copy link
Author

For anyone else having the same issue: It looks like on macOS, WebviewWindow.setPosition accepts LogicalPosition instead of PhysicalPosition. If, for example, you get your coords from Monitor, which provides PhysicalPosition on both Mac and Windows, you will need to convert this PhysicalPosition to LogicalPosition.

Similar issue here #1057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants