forge
Explore
Log in

Don't you dare go Hollow

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

Browse files at this commit

f3f6e79eeca8924ff9cfea4b30006e5b782bc93eIvan MolodetskikhParent: 83ec369
This isn't the correct solution, but it seems to work often enough for window
icons in the screencast dialog.
src/niri.rsmodified+9 -2
@@ -2184,7 +2184,7 @@ impl State {
21842184 self.niri.dynamic_cast_id_for_portal.get(),
21852185 gnome_shell_introspect::WindowProperties {
21862186 title: String::from("niri Dynamic Cast Target"),
2187- app_id: String::from("rs.bxt.niri"),
2187+ app_id: String::from("rs.bxt.niri.desktop"),
21882188 },
21892189 );
21902190
@@ -2193,7 +2193,14 @@ impl State {
21932193 let props = with_toplevel_role(mapped.toplevel(), |role| {
21942194 gnome_shell_introspect::WindowProperties {
21952195 title: role.title.clone().unwrap_or_default(),
2196- app_id: role.app_id.clone().unwrap_or_default(),
2196+ app_id: role
2197+ .app_id
2198+ .as_ref()
2199+ // We don't do proper .desktop file tracking (it's quite involved), and
2200+ // Wayland windows can set any app id they want. However, this seems to
2201+ // work well enough in practice.
2202+ .map(|app_id| format!("{app_id}.desktop"))
2203+ .unwrap_or_default(),
21972204 }
21982205 });
21992206