Skip to content

Startup tracking with xdg-activation

Guido Günther requested to merge guidog/gtk:startup-vs-xdg-activation into main

When a GTK4 app starts it ends up emitting it's startup id via gtk_shell1_set_startup_id for wayland (when xdg-activation is unavailable) and similar for x11 based apps via "startup notificication protocol" but this currently does not happen for me when xdg-activation is being used.

From what i figured this is because gtk_window_present_with_time() doesn't end up calling gdk_toplevel_focus() and hence xdg_activation_v1_activate is not being called. If that is adjusted one needs to keep the startup_notification_id around a bit long and things start to work.

I'm marking this as RFC since I'm less than sure if this is the right way to approach it but with this applied, gtk4 apps do report their startup so compositors handling xdg-activation can track it. Otherwise they just see (depending on protocol) a token request but never an activation.

Edited by Guido Günther

Merge request reports