Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
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
- install the desktop file
cp iced-startup-token-repro.desktop ~/.local/share/applications/
update-desktop-database ~/.local/share/applications/
- Type the name of the application in the application launcher, select it, and launch it.
- 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
Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
Issue description
When starting apps made with
iced.rsthrough a.desktopfile 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.rscodeiced-startup-token-repro.desktopfileSteps
Workaround
Replacing the
Exec=line withExec=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 futureWindow::request_user_attentionflows.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
.desktopshortcuts, and the output wouldn't be interesting anyway. But I have interesting context.Environment
iced0.14.0winit0.30.13 (transitive viaiced_winit)wayland-client0.31.13with
xdg_activation_v1(KWin, sway, hyprland, wayfire) are expected tobehave the same way as the protocol semantics are identical.
References