tauri
tauri copied to clipboard
[bug] Getting outer position of window on Ubuntu ignores caption and borders
Describe the bug
When I try to get outer position of window the outerPosition should take into account window system caption and border but it is not. Because of this I get window position with offset x=1 px and y=34 px instead of 0-0.
Event in full screen mode y have offset identical to window caption.
Reproduction
- Place this code in main.ts
setInterval(async () => {
const currentWindow = getCurrentWindow();
const outerPosition = await currentWindow.outerPosition();
console.log('outerPosition:', outerPosition);
}, 1000);
-
Run app
-
Move app to top-left corner of screen
-
Check log in console
Expected behavior
The console.log('outerPosition:', outerPosition); should present window position x=0 and y=0.
Full tauri info output
[✔] Environment
- OS: Ubuntu 24.4.0 x86_64 (X64)
✔ webkit2gtk-4.1: 2.46.1
✔ rsvg2: 2.58.0
✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 22.5.1
- npm: 10.8.2
[-] Packages
- tauri 🦀: 2.0.6
- tauri-build 🦀: 2.0.2
- wry 🦀: 0.46.3
- tao 🦀: 0.30.3
- @tauri-apps/api : 2.0.3
- @tauri-apps/cli : 2.0.5
[-] Plugins
- tauri-plugin-shell 🦀: 2.0.2
- @tauri-apps/plugin-shell : 2.0.1
- tauri-plugin-fs 🦀: 2.0.3
- @tauri-apps/plugin-fs : 2.0.1
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- bundler: Vite
Stack trace
No response
Additional context
No response