Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FengZhongShaoNian opened this issue May 20, 2024 · 0 comments
Labels
platform: Linux status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@FengZhongShaoNian
Copy link

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

@FengZhongShaoNian FengZhongShaoNian added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Linux status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants