Skip to content
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] (macOS) reset size when move cross monitor that has different scale factor #5229

Closed
BillGoldenWater opened this issue Sep 18, 2022 · 2 comments · Fixed by tauri-apps/tao#710
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@BillGoldenWater
Copy link
Contributor

Describe the bug

when use Window::set_position to set to a position that have a different monitor than last position, the window's size will reset to default.

Reproduction

  1. set window size to non default size
  2. set position to another monitor
  3. the size will reset to default size

Expected behavior

the size still be the same size before set pos

Platform and versions

Environment
› OS: Mac OS 12.6.0 X64
› Node.js: 18.7.0
› npm: 8.15.0
› pnpm: 6.11.0
› yarn: 1.22.18
› rustup: 1.25.1
› rustc: 1.62.0
› cargo: 1.62.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
› @tauri-apps/cli [NPM]: 1.1.5
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.1.1,
› tauri-build [RUST]: 1.1.1,
› tao [RUST]: 0.14.0,
› wry [RUST]: 0.21.1,

App
› framework: React

App directory structure
├─ original
├─ dist
├─ node_modules
├─ script
├─ public
├─ .github
├─ src-tauri
├─ .git
├─ .idea
└─ src

Stack trace

No response

Additional context

apple silicon, 2nd monitor has scaled

@Lpmvb
Copy link

Lpmvb commented Jan 28, 2023

I have the same problem, is there a solution?

@BillGoldenWater BillGoldenWater changed the title [bug] set position will reset size when cross monitor on macOS [bug] (macOS) reset size when move cross monitor that has different scale factor Mar 6, 2023
@BillGoldenWater
Copy link
Contributor Author

this issue is because the suggest_size of scale_factor_change event is get from a cached ns_view
and the actual ns_view is replaced by the wry

suggest_size view_size ns_view
wry replacing ns_view

change the get method to dynamically get is fixing this issue
also fix this: resize event in tauri

and seems the latest winit is dynamically get the ns_view by contentView winit's impl

@wusyong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants