tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Height of window on MacOS takes the outer size while on Windows/Linux it takes the inner size

Open WilfredC64 opened this issue 3 years ago • 1 comments

Describe the bug

The height of a window set in tauri.conf.json or created via WindowBuilder is not the same on all platforms. This is problematic when you want to have a fixed sized window that is not resizable and where you don't want to display scroll bars.

On MacOS the height that is set for the window is the outer size and on Windows/Linux it sets the inner size. When a height is configured to e.g. 600 pixels, I expect that the window is created with an inner size of 600 pixels so the design of your page can rely on this.

Reproduction

  1. Create a new app with create-tauri-app on MacOS, confirm all defaults and run it.
  2. Make a screenshot of the window and measure the height of the full window and of the inner size with e.g. a paint program .

Compare this with Windows/Linux and notice that it's not the same. The default app has set the height to 600 pixels. On Windows/Linux the inner height is set to 600 pixels and on MacOS the full window including the title bar is set to 600 pixels.

Expected behavior

Windows created on MacOS should set the height of a window as the inner size so that it is consistent with all other platforms.

Platform and versions

Environment
  › OS: Mac OS 12.3.1 X64
  › Node.js: 16.14.2
  › npm: 8.5.0
  › pnpm: Not installed!
  › yarn: 1.22.10
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-x86_64-apple-darwin

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.12
  › @tauri-apps/api [NPM]: 1.0.0-rc.6
  › tauri [RUST]: 1.0.0-rc.13,
  › tauri-build [RUST]: 1.0.0-rc.11,
  › tao [RUST]: 0.9.1,
  › wry [RUST]: 0.17.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: ../dist

App directory structure
  ├─ dist
  ├─ node_modules
  └─ src-tauri

Stack trace

No response

Additional context

No response

WilfredC64 avatar May 27 '22 09:05 WilfredC64

Had the same issue, and now I understand why. I'm using platform-specific settings for now but yeah it would be good to have consistency in window size.

boan-anbo avatar Jul 19 '22 00:07 boan-anbo

on macos we set the content size https://developer.apple.com/documentation/uikit/uiscrollview/1619399-contentsize?language=objc so on all platforms we are setting the inner size so this bug seems like a normal behavior for macOS and one that we cannot control.

amrbashir avatar Sep 30 '22 14:09 amrbashir