Replace libappindicator with ksni
Using ksni and the xdg standard for tray icons on Linux unlocks missing functionality and new features (https://github.com/tauri-apps/tray-icon/issues/104 and more), as well as unblocks a GTK4 migration (https://github.com/tauri-apps/webkit2gtk-rs/issues/94).
- Predefined menu items are not handled, except
separatorandabout. - Shortcuts are ignored.
Companion PR for muda: Export more internals so muda can be used in combination with ksni: https://github.com/tauri-apps/muda/pull/239
Tauri issue: [feat] Use ksni crate for tray icons on Linux: https://github.com/tauri-apps/tauri/issues/11293
@amrbashir @FabianLars How do we proceed from here? The tests fail because the PR depends on https://github.com/tauri-apps/muda/pull/239.
you can make tray-icon depend on the git version of muda for now
Sorry for the delay, been a bit busy IRL, and also not sure if we want to have this in tauri v2, keep old implementation and add it in tauri v2 behind a feature flag or wait for v3
if we make v3 only about switching from gtk3 to gtk4 (which imo we should) this change could wait for v3. If v3 takes ages i think it would be better to add it in v2 if that's not too much of a headache. I wouldn't put it behind a feature flag either way unless there's something missing compared to the libappindicator implementation that i don't see rn.
Alright. Then please keep me updated. And I updated the muda dependency.
I am actually leaning towards keeping the old implementation for now and adding this behind experimental feature flag (ksni) for both, tray-icon crate and tauri crate
I put the ksni stuff behind a feature flag linux-ksni (I also renamed the muda feature).
I also created a new PR for tauri (https://github.com/tauri-apps/tauri/pull/12319).
And it seems the compiler has become more strict. I'm still fixing the windows issues. The macos issue I don't understand, though.
the macos issue should be fixed by https://github.com/tauri-apps/tray-icon/pull/220
I rebased the PR, but now the about dialog crashes:
cargo run --example tao -F linux-ksni
(tao:1924160): Gtk-CRITICAL **: 14:46:21.228: gtk_text_attributes_ref: assertion 'values != NULL' failed
(tao:1924160): Gtk-CRITICAL **: 14:46:21.228: gtk_text_attributes_ref: assertion 'values != NULL' failed
(tao:1924160): Pango-CRITICAL **: 14:46:21.228: pango_layout_new: assertion 'context != NULL' failed
Speicherzugriffsfehler (Speicherabzug geschrieben)
Is there anything preventing this issue from being merged? I'm happy to help but I don't know what still needs to be done.
That is a very interesting PR, any plans to finish it?