Skip to content

Taskbar takes 20s to "bind" the window after app starts (Linux, XDG-compliant desktops) #3317

@castarco

Description

@castarco

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

Issue description

When starting apps made with iced.rs through a .desktop file in certain Linux environments such as Gnome, it takes 20 seconds for the taskbar to bind the application's window. In other words, I can't see the app listed in the taskbar for the first 20 seconds.

This does not happen when the application is launched via command line.

Issue reproduction

main.rs code

use iced::widget::text;
use iced::{Element, Size, Task, window};

#[derive(Debug, Clone)]
enum Message {}

#[derive(Default)]
struct State;

fn update(_state: &mut State, _msg: Message) -> Task<Message> {
    Task::none()
}

fn view(_state: &State) -> Element<'_, Message> {
    text("iced startup token reproducer").into()
}

fn main() -> iced::Result {
    eprintln!(
        "XDG_ACTIVATION_TOKEN at startup = {:?}",
        std::env::var("XDG_ACTIVATION_TOKEN").ok()
    );

    iced::application(State::default, update, view)
        .title("iced-startup-token-repro")
        .window(window::Settings {
            size: Size::new(480.0, 240.0),
            platform_specific: iced::window::settings::PlatformSpecific {
                application_id: "iced-startup-token-repro".to_string(),
                ..Default::default()
            },
            ..Default::default()
        })
        .run()
}

iced-startup-token-repro.desktop file

[Desktop Entry]
Type=Application
Version=1.0
Name=Iced Startup Token Repro
Exec=ABSOLUTE_PATH_TO_BINARY
Terminal=false
Categories=Utility;
StartupNotify=false
StartupWMClass=iced-startup-token-repro

Steps

  1. install the desktop file
    cp iced-startup-token-repro.desktop ~/.local/share/applications/
    update-desktop-database ~/.local/share/applications/
  2. Type the name of the application in the application launcher, select it, and launch it.
  3. Observe how the app window takes 20s to be bound to the desktop taskbar.

Workaround

Replacing the Exec= line with Exec=env -u XDG_ACTIVATION_TOKEN <binary_path> makes the dock-bind delay disappear, at the cost of breaking focus-stealing prevention on launch and any future Window::request_user_attention flows.

What is the expected behavior?

When I open the app through its .desktop "shortcut", the taskbar should bind the app's window "immediately" (milliseconds count as immediate from a user's perspective).

Version

crates.io release

Operating System

Linux

Do you have any log output?

No. It is not so easy when launching the app through the .desktop shortcuts, and the output wouldn't be interesting anyway. But I have interesting context.

Environment

  • iced 0.14.0
  • winit 0.30.13 (transitive via iced_winit)
  • wayland-client 0.31.13
  • GNOME Shell 50.1, Ubuntu Dock 50, Wayland session, Ubuntu 25.10-equivalent
  • Reproduced on a single Wayland compositor (Mutter); other compositors
    with xdg_activation_v1 (KWin, sway, hyprland, wayfire) are expected to
    behave the same way as the protocol semantics are identical.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions