tauri-apps/tauri

[bug] when multiple monitors have `different scaling` settings, the window cannot switch correctly between monitors

lh123 opened this issue · 4 comments

Describe the bug

image

  • monitor 1
    image
  • monitor 2
    image

when multiple monitors have different scaling settings, the window cannot switch correctly between monitors

Reproduction

when multiple monitors have different scaling settings, using windows + shift + Arrow to move a window to another screen, the window does not move correctly to the second screen.

3.mp4

Expected behavior

The window should move correctly to another screen.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 126.0.2592.87
    ✔ MSVC: Visual Studio ���ɹ��� 2022
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.11.0
    - pnpm: 8.6.3
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 1.7.1
    - tauri-build [RUST]: 1.5.3
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - tauri-cli [RUST]: 1.6.0
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

I have the same problem

A similar issue that I have which is probably linked, I find it difficult to move my Tauri app window between screens of different scale.

  • By "moving", I mean dragging with the mouse
  • By "difficult", I mean that the window keeps getting resized, and I can't make it cross the screen : the window is kind of stuck on the first screen

Here is my setup:

 ----------     ----------     ----------
| Screen 2 |   | Screen 1 |   | Screen 3 |
 ----------     ----------     ----------
  • Screen 1 is 2560 x 1440 @ 125%
  • Screen 2 and 3 are 1920 x 1080 @ 100%

I found that it's pretty difficult to move my Tauri app windows between Screen 1 and Screen 2, but it's okay between Screen 1 and Screen 3.

Temporal solution I found: move the window slowly between the screens, so it gets resized (due to the change of scale) before the cursor cross the screen.

Note: I'm on Windows 11 using Tauri 2

I have the exact same issue as @hugoattal. The window moves back while resizing and it's difficult to even get it over to the second monitor. This worked better in Tauri v1. Not perfect but much better than in v2.

Here's my tauri info:

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 131.0.2903.112
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Professional 2022
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.2.0
    - npm: 10.9.1

[-] Packages
    - tauri :crab:: 2.1.1
    - tauri-build :crab:: 2.0.3
    - wry :crab:: 0.47.2
    - tao :crab:: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-shell :crab:: 2.2.0
    - @tauri-apps/plugin-shell : 2.2.0
    - tauri-plugin-fs :crab:: 2.2.0
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-dialog :crab:: 2.2.0
    - @tauri-apps/plugin-dialog : 2.2.0
    - tauri-plugin-updater :crab:: 2.3.0
    - @tauri-apps/plugin-updater : 2.3.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

所以还是没有解决?