tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
82.46k stars 2.48k forks source link

[bug] UI does not fit properly when scale factor is higher than 100% #8602

Open elibroftw opened 8 months ago

elibroftw commented 8 months ago

Describe the bug

First two screenshots are of the app I'm working on with the display set to 125% and 100% on a Linux Mint (Ubuntu derivative) VM on VirtualBox. Notice that the UI is blown up.

125% image 100% image

Native Linux Mint App (100%) image Native Linux Mint App (125%) image

Reproduction

No response

Expected behavior

The UI should not be scaling. I'm not sure if this is CSS issue or if this is a Tauri issue, but writing a ticket here just in case.

Full tauri info output

yarn run v1.22.21
$ tauri info
WARNING: Only one package manager should be used, but found yarn and bun.
         Please remove unused package manager lock files, will use yarn for now!

[✔] Environment
    - OS: Linux Mint 21.2 X64
    ✔ webkit2gtk-4.0: 2.42.3
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.75.0 (82e1608df 2023-12-21)
    ✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: 1.75.0-x86_64-unknown-linux-gnu (overridden by '/home/elijah/Documents/CodeRepos/obscuravpn-app/rust-toolchain.toml')
    - node: 20.9.0
    - pnpm: 8.14.1
    - yarn: 1.22.21
    - npm: 10.1.0

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.6
    - tao [RUST]: 0.16.5
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App
Done in 18.39s.

Stack trace

No response

Additional context

No response

elibroftw commented 8 months ago

Fix we are using currently


#[cfg(target_os = "linux")]
fn webkit_hidpi_workaround() {
  // See: https://github.com/spacedriveapp/spacedrive/issues/1512#issuecomment-1758550164
  std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
}

fn main_prelude() {
  #[cfg(target_os = "linux")]
  webkit_hidpi_workaround();
}

fn main() {
  main_prelude();
// ...
}
FabianLars commented 8 months ago

wow what is not broken in the new renderer 👀 Glad you found a workaround and i still wonder if we should just hardcode it in tauri itself...