tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Incorrect DPI scaling on Wayland/Linux

Open happenslol opened this issue 3 years ago • 5 comments

Describe the bug

Running a freshly initialized tauri project on a 2256x1504 Laptop produces the following window when running yarn tauri dev:

2022-11-09_21-34_1

Opening the URL of the local dev server in chrome with the ozone platform enabled shows the following:

2022-11-09_21-34

It seems like the webview is not doing any scaling at all. Setting GDK_SCALE or GDK_DPI_SCALE does not have any effect either.

Reproduction

  1. Run cargo-create-tauri-app
  2. Run yarn tauri dev on a HiDPI-screen

Expected behavior

The scaling should be the same in the GTK WebView as in a correctly scaled Chromium or Firefox window.

Platform and versions

Running on NixOS with Sway/Wayland and scaling set to 1.5, using the recommended flake.nix.

$ tauri info

Environment
  › OS: NixOS 22.11.0 X64
  › Node.js: 18.9.1
  › npm: 8.19.1
  › pnpm: Not installed!
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.64.0
  › cargo: 1.64.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu

Packages
  › @tauri-apps/cli [NPM]: 1.2.0
  › @tauri-apps/api [NPM]: 1.2.0
  › tauri [RUST]: 1.2.0,
  › tauri-build [RUST]: 1.2.0,
  › tao [RUST]: 0.15.3,
  › wry [RUST]: 0.22.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:1420/
  › framework: React

App directory structure
  ├─ public
  ├─ node_modules
  ├─ src-tauri
  ├─ .vscode
  ├─ .direnv
  └─ src

Stack trace

No response

Additional context

No response

happenslol avatar Nov 09 '22 20:11 happenslol

Does anyone have any input on this? Is this maybe a better fit for another tauri-apps repository, since it deals more directly with the windowing/webkit2gtk layer? I'd also be open to digging into this if anyone could point me in the right direction.

I'd really love to use tauri for a project of mine, but this is really standing in the way of that.

happenslol avatar Nov 26 '22 00:11 happenslol

Is website with any URL link also affected? I've auto scaled the gtk window iirc. Search a bit on webkit2gtk and I found it might need to do it manually. I can test this in wry if there's a minimum example to reproduce.

wusyong avatar Nov 26 '22 04:11 wusyong

image

User has 200% scaling, cannot scroll

elibroftw avatar Dec 30 '23 21:12 elibroftw

Experiencing the same issue here. Any update on the situation?

AaronHessler avatar Mar 14 '25 19:03 AaronHessler

I think this might not be an issue related to tauri, but nixos instead. I also happen to use nixos (btw).

AaronHessler avatar Mar 14 '25 19:03 AaronHessler

I am also experiencing the same issue. Using endeavour os with hyprland

ryadios avatar Dec 16 '25 08:12 ryadios