tauri: [bug] V2 Tauri custom titlebar unable to resize when decorations is false
Describe the bug
I was trying v2 of tauri and I noticed that if you set decorations to false in the tauri.conf.json the ability to resize the application is impossible even if you set resizable to true.
Reproduction
npm create tauri-app@latest -- --alpha- add the demo titlebar to the project :
- make those configuration in the tauri.conf.json :
{
"build": {
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn build",
"devPath": "http://localhost:1420",
"distDir": "../dist",
"withGlobalTauri": true
},
"package": {
"productName": "tauri-app",
"version": "0.0.0"
},
"tauri": {
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.tauri.dev",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
},
"security": {
"csp": null
},
"windows": [
{
"decorations": false,
"fullscreen": false,
"resizable": true,
"title": "tauri-app",
"width": 800,
"height": 600
}
]
},
"plugins": {
"shell": {
"open": true
},
"allowlist":{
"all": true,
"window": {
"center": false,
"close": true,
"create": false,
"hide": false,
"maximize": true,
"minimize": true,
"print": false,
"requestUserAttention": false,
"setAlwaysOnTop": false,
"setCursorGrab": true,
"setCursorIcon": true,
"setCursorPosition": false,
"setCursorVisible": false,
"setDecorations": false,
"setFocus": true,
"setFullscreen": true,
"setIcon": true,
"setMaxSize": false,
"setMinSize": false,
"setPosition": false,
"setResizable": true,
"setSize": true,
"setSkipTaskbar": false,
"setTitle": true,
"show": true,
"startDragging": true,
"unmaximize": true,
"unminimize": true
}
}
}
}
Expected behavior
the application is able to be resize when decorations is set to false
Full tauri info output
[✔] Environment
- OS: openSUSE 20231226 X64
✔ webkit2gtk-4.1: 2.42.4
✔ rsvg2: 2.57.0
✔ rustc: 1.74.1 (a28077b28 2023-12-04)
✔ cargo: 1.74.1 (ecb9851af 2023-10-18)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 21.4.0
- pnpm: 8.11.0
- yarn: 1.22.21
- npm: 10.2.4
[-] Packages
- tauri [RUST]: 2.0.0-alpha.20
- tauri-build [RUST]: 2.0.0-alpha.13
- wry [RUST]: 0.35.1
- tao [RUST]: 0.24.0
- tauri-cli [RUST]: 2.0.0-alpha.20
- @tauri-apps/api [NPM]: 2.0.0-alpha.13
- @tauri-apps/cli [NPM]: 2.0.0-alpha.20
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:1420/
- bundler: Vite
Stack trace
No response
Additional context
I have tested this on Linux and Windows and the same bug happen and I am pretty sure it also the same thing on macOS
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (3 by maintainers)
Commits related to this issue
- fix(core): fix undecorated window resizing, fixes #8519 — committed to tauri-apps/tauri by amrbashir 3 years ago
- fix(core): fix undecorated window resizing, #8519 (#8537) * fix(core): fix undecorated window resizing, fixes #8519 * js api * fix invoke call * Update tauri-window-start-resize-dragging.md... — committed to TCOTC/tauri by amrbashir 3 years ago
Interesting detail… If you set
window_builder.shadow(false)resizing works again… 🤔🤔It seems to still be an issue. When doing
window_builder.decorations(false)the window cannot be resized by f.ex doinggetCurrentWindow().setSize(...)in javascript. I’m on latest Tauri (2.1.1)It works fine on MacOS, the issue is on windows (I have only tried Windows 11)
Hi, I’m using the beta.23 version. In the initial project,
"decorations": falseresizing the window works fine, but when I addunstableto the Tauri features, it stops working. Is there a way to solve this?same question
Should be fixed in the next release with https://github.com/tauri-apps/tauri/pull/9862
This bug seems to still exist in the latest version(beta.20)?
Is there any way to downgrade tauri package to a working version. when i change version in cargo it gets ignored
The pr that fixes it is linked right above your comment 😅
It will be part of the next alpha release.