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

  1. npm create tauri-app@latest -- --alpha
  2. add the demo titlebar to the project :
  3. 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

Most upvoted comments

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 doing getCurrentWindow().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": false resizing the window works fine, but when I add unstable to the Tauri features, it stops working. Is there a way to solve this?

It seems to still be an issue. When doing window_builder.decorations(false) the window cannot be resized by f.ex doing getCurrentWindow().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)

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 😅 grafik It will be part of the next alpha release.