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.56k stars 2.59k forks source link

[bug] Hiding taskbar icons on Linux does not work when using wayland #9829

Open FengZhongShaoNian opened 6 months ago

FengZhongShaoNian commented 6 months ago

Describe the bug

I want to hide the icon from taskbar by using main_window.set_skip_taskbar(true),but this does't work if the app is running with wayland:

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use tauri::Manager;

// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
    format!("Hello, {}! You've been greeted from Rust!", name)
}

fn main() {
    tauri::Builder::default()
        .setup(|app|{
            let main_window = app.get_window("main").unwrap();
            main_window.set_skip_taskbar(true).unwrap(); // This doesn't work when using wayland!
            Ok(())
        })
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

The icon is still visible in the taskbar: 图片

I can hide the icon by forcing the app to run with x11 (using GDK_BACKEND=x11 environment variable), but I hope that when running it using native wayland, the application icon can also be hidden from the taskbar.

Reproduction

https://github.com/FengZhongShaoNian/tauri-hide-appicon-from-taskbbar

Expected behavior

I hope that when running it using native wayland, the application icon can also be hidden from the taskbar.

Full tauri info output

[✔] Environment
    - OS: Arch Linux Unknown X64
    ✔ webkit2gtk-4.0: 2.44.2
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.13.1
    - pnpm: 9.1.1
    - npm: 10.5.2

[-] Packages
    - tauri [RUST]: 1.6.6
    - tauri-build [RUST]: 1.5.2
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - @tauri-apps/api [NPM]: 1.5.6
    - @tauri-apps/cli [NPM]: 1.5.14

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

No response

vincehi commented 5 months ago
I have this issue me too : error: proc macro panicked --> src/main.rs:20:17 20 let context = tauri::generate_context!(); ^^^^^^^^^^^^^^^^^^^^^^^^^^

= help: message: icon /home/runner/work/pulp/pulp/src-tauri/icons/32x32.png is not RGBA

https://github.com/vincehi/pulp/actions/runs/9496072496/job/26169705434