Return app ids with ".desktop" appended to Shell.Introspect

This isn't the correct solution, but it seems to work often enough for window
icons in the screencast dialog.
This commit is contained in:
Ivan Molodetskikh
2025-06-13 09:54:11 +03:00
parent 83ec369536
commit f3f6e79eec
+9 -2
View File
@@ -2184,7 +2184,7 @@ impl State {
self.niri.dynamic_cast_id_for_portal.get(),
gnome_shell_introspect::WindowProperties {
title: String::from("niri Dynamic Cast Target"),
app_id: String::from("rs.bxt.niri"),
app_id: String::from("rs.bxt.niri.desktop"),
},
);
@@ -2193,7 +2193,14 @@ impl State {
let props = with_toplevel_role(mapped.toplevel(), |role| {
gnome_shell_introspect::WindowProperties {
title: role.title.clone().unwrap_or_default(),
app_id: role.app_id.clone().unwrap_or_default(),
app_id: role
.app_id
.as_ref()
// We don't do proper .desktop file tracking (it's quite involved), and
// Wayland windows can set any app id they want. However, this seems to
// work well enough in practice.
.map(|app_id| format!("{app_id}.desktop"))
.unwrap_or_default(),
}
});