tauri-apps / tauri

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

[bug] Title bar buttons are not working on Linux when resizable is set to false and skip_taskbar is set to true #11631

Closed WilfredC64 closed 1 week ago

WilfredC64 commented 2 weeks ago

Describe the bug

On Linux when setting resizable to false and skip_taskbar to true on the Webview, the maximize button disappears in the title bar and the minimize and close buttons are unusable with some extra whitespace between the buttons .

Also, when resizable and skip_taskbar are set to true, in order to use the title bar buttons, you need to double click on the title bar which maximizes the window, regardless if maximizable is set to false, and then the buttons are usable.

On Windows and macOS, the above issues don't exists, the issues mentioned above only exists on Linux.

I create the Webview programmatically like:

WebviewWindowBuilder::new(app, "about", WebviewUrl::App("/pages/about/index.html".into()))
    .title("TITLE")
    .inner_size(600.0, 512.0)
    .min_inner_size(600.0, 512.0)
    .center()
    .maximizable(false)
    .resizable(false)
    .fullscreen(false)
    .skip_taskbar(true)
    .build()?;

Reproduction

In order to reproduce the issue, you need to create a webview where resizable is set to false and skip_taskbar is set to true. Doing it programmatically you can reproduce it like:

WebviewWindowBuilder::new(app, "about", WebviewUrl::App("/pages/about/index.html".into())) .title("TITLE") .inner_size(600.0, 512.0) .min_inner_size(600.0, 512.0) .center() .maximizable(false) .resizable(false) .fullscreen(false) .skip_taskbar(true) .build()?;

Existing repo where it's done the same can be found in main.rs in: https://github.com/WilfredC64/sid-device

Expected behavior

When I create a Webview Window which is not resizable and where I skip task bar, I expect that the minimize and close buttons in the title bar are clickable and working.

Full tauri info output

Environment
    - OS: Ubuntu 22.4.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.1
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.18.0
    - npm: 10.8.2

[-] Packages
    - tauri 🦀: 2.0.6
    - tauri-build 🦀: 2.0.2
    - wry 🦀: 0.46.3
    - tao 🦀: 0.30.6
    - @tauri-apps/api : 2.0.3
    - @tauri-apps/cli : 2.0.5

[-] Plugins
    - tauri-plugin-dialog 🦀: 2.0.3
    - @tauri-apps/plugin-dialog : 2.0.1
    - tauri-plugin-single-instance 🦀: 2.0.1
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-fs 🦀: 2.0.3
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-autostart 🦀: 2.0.1
    - @tauri-apps/plugin-autostart : not installed!

[-] App
    - build-type: bundle
    - CSP: default-src 'self'; connect-src ipc: http://ipc.localhost
    - frontendDist: ../dist
    - devUrl: http://localhost:5173/
    - framework: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

No response

amrbashir commented 1 week ago

are you using gnome on Wayland?

WilfredC64 commented 1 week ago

Yes, echo $XDG_SESSION_TYPE outputs wayland and echo $DESKTOP_SESSION outputs ubuntu.

Also I forgot to mention that a previous build of my application using Tauri V1, didn't have the issue. It runs fine on the same Ubuntu environment.

amrbashir commented 1 week ago

On Linux when setting resizable to false and skip_taskbar to true on the Webview, the maximize button disappears in the title bar and the minimize and close buttons are unusable with some extra whitespace between the buttons .

Also, when resizable and skip_taskbar are set to true, in order to use the title bar buttons, you need to double click on the title bar which maximizes the window, regardless if maximizable is set to false, and then the buttons are usable.